Skip to content
Snippets Groups Projects
Commit b22e7745 authored by František Dvořák's avatar František Dvořák
Browse files

gitLab CI: can't use after_script for releasing IP - the environment vanishes there

parent 8d99403b
Branches
Tags
No related merge requests found
Pipeline #2266 failed
...@@ -45,8 +45,6 @@ test-single: ...@@ -45,8 +45,6 @@ test-single:
# better to init terraform before allocating public floating IP address (the state could be locked) # better to init terraform before allocating public floating IP address (the state could be locked)
- terraform init -input=false - terraform init -input=false
- ip=`openstack floating ip create -c floating_ip_address -f value public-muni-147-251-21-GROUP` - ip=`openstack floating ip create -c floating_ip_address -f value public-muni-147-251-21-GROUP`
after_script: &after
- openstack floating ip delete $ip
cache: cache:
when: always when: always
key: single key: single
...@@ -59,6 +57,7 @@ test-single: ...@@ -59,6 +57,7 @@ test-single:
- ssh-add ./ssh-key.terra1.txt - ssh-add ./ssh-key.terra1.txt
- ssh -o PreferredAuthentications=publickey deployadm@$ip "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'" - ssh -o PreferredAuthentications=publickey deployadm@$ip "sudo -u debian sh -c 'cd; ~deployadm/terraform/image/tests/run-tests.sh'"
- terraform destroy $args - terraform destroy $args
- openstack floating ip delete $ip
rules: rules:
- if: '$JOB =~ /all|test-single/' - if: '$JOB =~ /all|test-single/'
artifacts: &artifacts artifacts: &artifacts
...@@ -69,7 +68,6 @@ test-cluster: ...@@ -69,7 +68,6 @@ test-cluster:
stage: test stage: test
variables: *tfvars variables: *tfvars
before_script: *before before_script: *before
after_script: *after
cache: cache:
when: always when: always
key: cluster key: cluster
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment