From f7d4b2922163f18f29131bf9cd96d5339f8fb97a Mon Sep 17 00:00:00 2001 From: Drew Walters Date: Fri, 18 Jan 2019 12:59:01 -0600 Subject: [PATCH] airskiff: Add steps to Shipyard wait script Currently, the Airskiff gate does not recognize failures because the gate script only verifies that an action lifecycle enters a COMPLETE state; however, a lifecycle in COMPLETE status is not always an indication of a successful deployment. This commit updates the wait_for_shipyard script to check the status of each action step and results in exit_code 1 if any steps failed. Change-Id: If5117c4638652b8d5b91fe73ede0f5e19a1e2cc1 --- tools/gate/wait-for-shipyard.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/gate/wait-for-shipyard.sh b/tools/gate/wait-for-shipyard.sh index f949f3bd4..5786563bc 100755 --- a/tools/gate/wait-for-shipyard.sh +++ b/tools/gate/wait-for-shipyard.sh @@ -26,6 +26,10 @@ while true; do status=$(${SHIPYARD} describe "$ACTION" | grep -i "Lifecycle" | \ awk '{print $2}') + steps=$(${SHIPYARD} describe "$ACTION" | grep -i "step/" | \ + awk '{print $3}') + + # Verify lifecycle status if [ "${status}" == "Failed" ]; then echo -e "\n$ACTION FAILED\n" ${SHIPYARD} describe "${ACTION}" @@ -33,6 +37,15 @@ while true; do fi if [ "${status}" == "Complete" ]; then + # Verify status of each action step + for step in $steps; do + if [ "${step}" == "failed" ]; then + echo -e "\n$ACTION FAILED\n" + ${SHIPYARD} describe "${ACTION}" + exit 1 + fi + done + echo -e "\n$ACTION completed SUCCESSFULLY\n" ${SHIPYARD} describe "${ACTION}" exit 0