[SEAWORTHY] Stop Shipyard job after failure

Change-Id: If7b728176fd75792b7cd6cceed64e3874daf673f
This commit is contained in:
Thirunavukkarasu Palani 2020-03-04 22:15:27 -06:00
parent a6f98d969e
commit 68b3fdd59a
2 changed files with 30 additions and 0 deletions

View File

@ -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 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() {

View File

@ -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