-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from internet2/PC_GrouperWS
add script to refresh instance
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
| 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 |