File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,16 @@ cleanup() {
15
15
sleep 50
16
16
done
17
17
18
- [[ " ${ELASTIC_IP_ID} " != null ]] && aws_execute " ec2 release-address \
19
- --allocation-id \" ${ELASTIC_IP_ID} \" "
18
+ if [[ " ${ELASTIC_IP_ID} " != null ]]; then
19
+ aws_execute " ec2 release-address \
20
+ --allocation-id \" ${ELASTIC_IP_ID} \" "
21
+ else
22
+ if [[ -n " ${AWS_BUILD_CLOUD_UNIQUE_LABEL} " ]]; then
23
+ ELASTIC_IP=" $( aws_execute -r -s " ec2 describe-addresses --filter \" Name=tag:purpose,Values=${AWS_BUILD_CLOUD_UNIQUE_LABEL} \" " ) "
24
+ ELASTIC_IP_ID=" $( echo " ${ELASTIC_IP} " | jq -r ' .Addresses[0].AllocationId' ) "
25
+ aws_execute " ec2 release-address --allocation-id \" ${ELASTIC_IP_ID} \" "
26
+ fi
27
+ fi
20
28
21
29
[[ " ${SECURITY_GROUP_ID} " != null ]] && aws_execute " ec2 delete-security-group \
22
30
--group-id \" ${SECURITY_GROUP_ID} \" \
You can’t perform that action at this time.
0 commit comments