diff --git a/tools/deployment/seaworthy-virt/airship_gate/lib/airship.sh b/tools/deployment/seaworthy-virt/airship_gate/lib/airship.sh index 26f4dbb78..03e36d13f 100644 --- a/tools/deployment/seaworthy-virt/airship_gate/lib/airship.sh +++ b/tools/deployment/seaworthy-virt/airship_gate/lib/airship.sh @@ -137,6 +137,14 @@ shipyard_action_wait() { done } +shipyard_action_stop() { + + ACTION_ID=$(shipyard_cmd get actions | grep -oE 'action/[0-9A-Z]+' | tail -1) + shipyard_cmd describe "${ACTION_ID}" + log "${ACTION}" + shipyard_cmd control stop "${ACTION_ID}" + echo -e "\n${ACTION_ID} terminated SUCCESSFULLY\n" +} # Re-use the ssh key from ssh-config # for MAAS-deployed nodes collect_ssh_key() { diff --git a/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-stop-site.sh b/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-stop-site.sh new file mode 100755 index 000000000..2169d1003 --- /dev/null +++ b/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-stop-site.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Copyright 2018 AT&T Intellectual Property. All other rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -e + +source "${GATE_UTILS}" + +cd "${TEMP_DIR}" + +shipyard_action_stop diff --git a/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-update-site.sh b/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-update-site.sh index 6b4d1621c..9d24e4e62 100755 --- a/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-update-site.sh +++ b/tools/deployment/seaworthy-virt/airship_gate/stages/shipyard-update-site.sh @@ -19,4 +19,4 @@ source "${GATE_UTILS}" cd "${TEMP_DIR}" -shipyard_action_wait update_site 1800 +shipyard_action_wait update_site 7200