forked from capability-boosters-dev/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_dev_update.sh
executable file
·48 lines (43 loc) · 1010 Bytes
/
docker_dev_update.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
#!/bin/bash -e
usage () {
echo "usage: $0 [-f] [-h] [-n phase]"
}
bad_usage () {
usage
exit 1
}
while getopts ":fhn:" opt
do
case $opt in
n )
case $OPTARG in
build )
SKIP_BUILD=true;;
code )
SKIP_CODE=true;;
* )
bad_usage;;
esac
echo "Skipping $OPTARG";;
f )
FORCE=yes;;
h )
usage;;
* )
echo "Sorry, -$OPTARG is not a valid option!"
bad_usage;;
esac
done
if [[ -z "$FORCE" && "$(docker-compose ps | wc -l)" -gt 2 ]] ; then
echo "You should probably stop services before running this command"
echo "(use -f to skip this check)"
exit 1
fi
[[ -z "$SKIP_CODE" ]] && ./script/canvas_update -n data
[[ -z "$SKIP_BUILD" ]] && docker-compose build --pull
if [[ -z "$SKIP_BUILD" ]] ; then
# assets are currently compiled during dc build --pull
docker-compose run --rm web ./script/canvas_update -n code -n assets
else
docker-compose run --rm web ./script/canvas_update -n code
fi