Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
InCommonTAP-Examples/Workbench/scripts/refresh-this-instance.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
40 lines (34 sloc)
923 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /etc/profile | |
DELETE_VOLUMES="false" | |
if [[ $1 == "-dv" ]]; then | |
echo "will delete volumes..." | |
DELETE_VOLUMES="true" | |
fi | |
function DisplayUsage() { | |
echo "** This script will bring down the workbench containers, " | |
echo "grab the latest workbench code and config from the main repo, " | |
echo "then restart the containers." | |
echo "" | |
echo "Usage:" | |
echo "$0 [-dv]" | |
echo "" | |
echo "Pass the -dv flag to also delete data volumes when refreshing this instance." | |
echo "" | |
exit 1 | |
} | |
if [[ $1 == "--?" ]] | [[ $1 == "--help" ]]; then | |
DisplayUsage | |
fi | |
if [[ $# -eq 1 ]]; then | |
if [[ $1 != "-dv" ]]; then DisplayUsage; fi | |
fi | |
pushd /csp-tap/InCommonTAP-Examples/Workbench | |
docker-compose down | |
if [[ $DELETE_VOLUMES == "true" ]]; then | |
echo "deleting volumes..." | |
docker volume rm $(docker volume ls -q) | |
fi | |
git pull | |
docker-compose up --build -d | |
popd |