diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-11-23 01:06:43 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2019-11-23 02:52:06 +0100 |
commit | bcaa8955583eafa5f6e7762a07b2b1dcc8747a75 (patch) | |
tree | 39762c685fdf6dd8dc3f4f2a78faad5fa3f784ce | |
parent | 14e2ddc502d6a4eceed5b315c685daa9250e3c0d (diff) |
Allow running deploy.sh out of tools
It completes "Deploy Script for all Sites." which adds this dependency [1].
[1] https://build.opnfv.org/ci/job/airship-deploy-daily-latest/46/console
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Change-Id: Ib8dae7b60e4bcef6f4e573762907ef12c5fdae5d
-rwxr-xr-x | tools/deploy.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/deploy.sh b/tools/deploy.sh index 109cc32..d226686 100755 --- a/tools/deploy.sh +++ b/tools/deploy.sh @@ -12,24 +12,24 @@ export GERRIT_REFSPEC=${GERRIT_REFSPEC:-master} export TERM_OPTS=${TERM_OPTS:-" "} -TMP_DIR=$(mktemp -d) -cd $TMP_DIR - -trap "{ sudo rm -rf $TMP_DIR; }" EXIT +## Source Environment Variables. help() { echo "Usage: deploy.sh <site_name> <deploy_site|update_site>" } -## Source Environment Variables. - if [[ $# -ne 2 ]] then help exit 1 fi -source ../site/$1/$1.env +source $(dirname "$(realpath $0)")/../site/$1/$1.env + +TMP_DIR=$(mktemp -d) +cd $TMP_DIR + +trap "{ sudo rm -rf $TMP_DIR; }" EXIT ## Deps @@ -151,20 +151,20 @@ create_public_network() { public-network } -case "$1" in +case "$2" in 'deploy_site') genesis_cleanup clone_repos pegleg_collect promenade_bundle genesis_deploy - site_action $1 + site_action $2 create_public_network ;; 'update_site') clone_repos pegleg_collect - site_action $1 + site_action $2 ;; *) help exit 1 |