From bcaa8955583eafa5f6e7762a07b2b1dcc8747a75 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Sat, 23 Nov 2019 01:06:43 +0100 Subject: Allow running deploy.sh out of tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ib8dae7b60e4bcef6f4e573762907ef12c5fdae5d --- tools/deploy.sh | 20 ++++++++++---------- 1 file 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 " } -## 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 -- cgit 1.2.3-korg