-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcontainer.sh
executable file
·58 lines (43 loc) · 1023 Bytes
/
container.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
#
# ./container.sh [common][options]
# Prepare staging branch for release.
# Does only local changes.
#
# Options:
#
# -c Continue with current container, don't pull an updated one.
#
# -u Update to latest website+content git commits
#
# For common options, see './common.sh -h'.
#
. $(dirname "`readlink -e "$0"`")/common.sh || exit 1
[[ "$1" == "-c" ]] && {
shift
PULL=''
:
} || {
PULL="--pull=always"
}
[[ "$1" == "-u" ]] && {
shift
upgit "website"
upgit "website/content"
}
MSG='Content & Website update\n'
scd "website"
vrun 'echo > _includes/announcement.html'
vrun 'rm Gemfile.lock ||:'
# container run
vrun "podman run $PULL -d --rm -v $PWD:/opt/developerportal/website:Z quay.io/developer-portal/devel"
sleep 15
vrun 'podman logs -l'
vrun 'podman ps -l --format "{{.Status}}" | grep "^Up "'
# container copy
vrun 'podman container cp "`podman ps -lq`:/opt/developerportal/website/_site/" .'
sleep 1
vrun 'podman stop -l'
cleanup
prepgit master
logg "Done\n"