forked from APSIMInitiative/apsim-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
33 lines (26 loc) · 893 Bytes
/
deploy.sh
File metadata and controls
33 lines (26 loc) · 893 Bytes
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
#!/usr/bin/env bash
# Make sure an argument was specified
if [[ -z $1 ]];
then
echo "Usage: deploy command"
echo " Where command is one of:"
echo " all brings all containers up "
echo " down bring docker stack down"
exit 1
fi
command=$1
set -euo pipefail # stop on errors
if [ $command == "down" ]; then
echo "Bringing docker stack down"
docker-compose --profile all down --timeout 60
else
if [ $command == "all" ]; then
echo "Deploying all containers"
chmod +x *.sh
./clean.sh
fi
echo "Bringing docker stack $command up"
# Restart the containers and builds any that have a build specification, ignoring any errors while stopping the running container.
docker-compose --profile $command down --timeout 60 | echo Ignoring errors...
docker-compose --profile $command up -d
fi