summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDustin Specker <dustin.specker@att.com>2019-02-28 15:16:06 -0600
committerDustin Specker <dustin.specker@att.com>2019-02-28 15:16:06 -0600
commitc234b72abd3f052f1147f21dc96a1a9a34b2f748 (patch)
tree27126550e2c0a13e43988f87681769cdc31fbdba
parentf4f57a1bbf3cc9ca6c868a11cc8923326c81b6dc (diff)
tools: generalize execute_shipyard_action
This enables passing any combination of actions and parameters to this script. This also makes it easier to add scripts for additional actions by not having to modify execute_shipyard_action. Updated redeploy_server to pass in servers as a param. Change-Id: I590183c28e8c66997ab85470902dbe9576c5c5f6
Notes
Notes (review): Code-Review+1: Jeffrey Williams <jw2610@att.com> Code-Review+1: Rick Bartra <rb560u@att.com> Code-Review+2: Sean Eagan <sean.eagan@att.com> Code-Review+1: Aaron Sheffield <ajs@sheffieldfamily.net> Code-Review+2: Drew Walters <drewwalters96@gmail.com> Workflow+1: Drew Walters <drewwalters96@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 12 Mar 2019 19:59:35 +0000 Reviewed-on: https://review.openstack.org/640830 Project: openstack/airship-shipyard Branch: refs/heads/master
-rwxr-xr-xtools/execute_shipyard_action.sh14
-rwxr-xr-xtools/redeploy_server.sh2
2 files changed, 3 insertions, 13 deletions
diff --git a/tools/execute_shipyard_action.sh b/tools/execute_shipyard_action.sh
index 024fb24..c9407d0 100755
--- a/tools/execute_shipyard_action.sh
+++ b/tools/execute_shipyard_action.sh
@@ -32,7 +32,7 @@ run_action () {
32 32
33 # Define Variables 33 # Define Variables
34 action=$1 34 action=$1
35 servers=$2 35 action_args="${@:2}"
36 36
37 # Define Color 37 # Define Color
38 NC='\033[0m' 38 NC='\033[0m'
@@ -47,17 +47,7 @@ run_action () {
47 # Execute action 47 # Execute action
48 echo -e "Execute ${action} Dag...\n" 48 echo -e "Execute ${action} Dag...\n"
49 49
50 # Note that deploy and update site do not require additional parameter 50 ${base_docker_command} ${SHIPYARD_IMAGE} create action ${action} ${action_args}
51 # to be passed in while redeploy_server requires user to indicate which
52 # servers to redeploy
53 if ! [[ ${servers} ]] && [[ ${action} ]]; then
54 ${base_docker_command} ${SHIPYARD_IMAGE} create action ${action}
55 elif [[ ${action} == 'redeploy_server' && ${servers} ]]; then
56 ${base_docker_command} ${SHIPYARD_IMAGE} create action redeploy_server --param="target_nodes=${servers}"
57 else
58 echo "Invalid Input!"
59 exit 1
60 fi
61 51
62 # The status or lifecycle phase of an action can be 52 # The status or lifecycle phase of an action can be
63 # 53 #
diff --git a/tools/redeploy_server.sh b/tools/redeploy_server.sh
index 8b35077..7ca7558 100755
--- a/tools/redeploy_server.sh
+++ b/tools/redeploy_server.sh
@@ -34,4 +34,4 @@ servers=$1
34source set_env 34source set_env
35 35
36# Execute shipyard action for redeploy_server 36# Execute shipyard action for redeploy_server
37bash execute_shipyard_action.sh 'redeploy_server' ${servers} 37bash execute_shipyard_action.sh 'redeploy_server' --param="target_nodes=${servers}"