Skip to content

add script to refresh instance #106

Merged
merged 2 commits into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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