Skip to content
Snippets Groups Projects
Commit 4d30ff15 authored by Eesaan Atluri's avatar Eesaan Atluri
Browse files

Merge branch 'Feat-remove-unused-code' into 'master'

Remove code that destroys TF resources after failure

See merge request rc/terraform-openstack!39
parents a56d68ae dab53408
No related branches found
No related tags found
1 merge request!39Remove code that destroys TF resources after failure
Pipeline #9402 passed with stages
in 3 minutes and 30 seconds
...@@ -88,16 +88,7 @@ tf-apply: ...@@ -88,16 +88,7 @@ tf-apply:
echo "image_ohpc defined as ${TF_VAR_image_ohpc}" echo "image_ohpc defined as ${TF_VAR_image_ohpc}"
fi fi
- export TF_VAR_keypair_name="os-gen-keypair-$BUILD_DATE" - export TF_VAR_keypair_name="os-gen-keypair-$BUILD_DATE"
- | - terraform apply -auto-approve
terraform apply -auto-approve
if [ $? -ne 0 ]; then
echo "Terraform apply failed. Running terraform destroy..."
terraform destroy -auto-approve
TF_SUCCESS=false
else
TF_SUCCESS=true
fi
echo "Terraform success: $TF_SUCCESS"
- export instance_floating_ip=$(terraform output -raw floating_ip_ohpc) - export instance_floating_ip=$(terraform output -raw floating_ip_ohpc)
- export instance_id=$(terraform output -raw xdmod_instance_id) - export instance_id=$(terraform output -raw xdmod_instance_id)
- echo "instance_floating_ip=${instance_floating_ip}" | tee -a $CI_PROJECT_DIR/vars.env - echo "instance_floating_ip=${instance_floating_ip}" | tee -a $CI_PROJECT_DIR/vars.env
......
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