Skip to content

Commit

Permalink
add script to refresh instance
Browse files Browse the repository at this point in the history
  • Loading branch information
pcaskey committed Jan 7, 2021
1 parent 12b2d9b commit d590b88
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Workbench/scripts/refresh-this-instance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

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

0 comments on commit d590b88

Please sign in to comment.