Skip to content
Snippets Groups Projects
Commit 8263504b authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Separate cleanup action when failure

parent 94ce1b0a
No related branches found
No related tags found
No related merge requests found
......@@ -142,6 +142,7 @@ test:
tags:
- build
script:
- FAILED=false
- OLD_INSTANCE_IP=$(openstack floating ip list --floating-ip-address $CHEAHA_IP -c "Fixed IP Address" -f value)
- echo $OLD_INSTANCE_IP
- |
......@@ -179,7 +180,13 @@ test:
- openstack server add floating ip $NEW_INSTANCE_ID $FLOATING_IP
- >
curl --retry 10 --retry-delay 20 --retry-connrefused https://knightly.rc.uab.edu/Shibboleth.sso/Metadata --resolve knightly.rc.uab.edu:443:$FLOATING_IP -kf
|| (openstack server delete $NEW_INSTANCE_ID && openstack image delete $BUILT_OOD_IMAGE_ID && false)
|| FAILED=true
- |
if [ $FAILED ]; then
openstack server delete $NEW_INSTANCE_ID
openstack image delete $BUILT_OOD_IMAGE_ID
false
fi
- |
if [ $CI_PIPELINE_SOURCE = "schedule" ]; then
openstack server remove floating ip $NEW_INSTANCE_ID $FLOATING_IP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment