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
This commit is contained in:
Drew Walters 2019-01-18 12:59:01 -06:00
parent 488048ce76
commit f7d4b29221
1 changed files with 13 additions and 0 deletions

View File

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