blackbirdchess-docker-dev/sync.sh

28 lines
832 B
Bash
Raw Normal View History

2017-07-15 15:40:25 +02:00
#!/bin/bash
if [[ $# -eq 0 ]] ; then
echo "Missing arguments. Please specify 'up' or 'down'.";
exit 1
fi
2017-07-15 15:46:52 +02:00
if [ "$1" == "up" ] ; then
2017-07-15 18:00:35 +02:00
echo "Initializing Docker Sync (may take several minutes the first time)";
2017-07-15 15:40:25 +02:00
docker-sync start;
echo "Initializing Docker Compose";
2017-07-15 17:13:50 +02:00
shift; # removing first argument
docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d ${@};
2017-07-15 15:46:52 +02:00
elif [ "$1" == "down" ]; then
2017-07-15 15:40:25 +02:00
echo "Stopping Docker Compose";
docker-compose down;
echo "Stopping Docker Sync";
2017-07-15 15:44:09 +02:00
docker-sync stop;
2017-07-15 17:01:52 +02:00
elif [ "$1" == "install" ]; then
echo "Installing docker-sync";
gem install docker-sync;
elif [ "$1" == "sync" ]; then
docker-sync sync;
elif [ "$1" == "clean" ]; then
docker-sync clean;
2017-07-15 15:46:52 +02:00
else
2017-07-15 17:13:50 +02:00
echo "Invalid argument. Use 'up','down','install','sync' or 'clean' ";
2017-07-15 15:40:25 +02:00
fi