|
21 | 21 | esac |
22 | 22 | done |
23 | 23 |
|
| 24 | +# shellcheck disable=SC2143 |
24 | 25 | if [ -n "$cleanup_id" ]; then |
25 | 26 | export IDENTIFIER="$cleanup_id" |
26 | 27 | fi |
|
72 | 73 | fi |
73 | 74 |
|
74 | 75 | local specific_test_flag="" |
| 76 | + # shellcheck disable=SC2143 |
75 | 77 | if [ -n "$specific_test" ]; then |
76 | 78 | specific_test_flag="-run=$specific_test" |
77 | 79 | fi |
78 | 80 |
|
79 | 81 | local package_pattern="" |
| 82 | + # shellcheck disable=SC2143 |
80 | 83 | if [ -n "$specific_package" ]; then |
81 | 84 | package_pattern="$specific_package" |
82 | 85 | else |
|
143 | 146 |
|
144 | 147 | echo "Clearing leftovers with Id $IDENTIFIER in $AWS_REGION..." |
145 | 148 |
|
| 149 | +# shellcheck disable=SC2143 |
146 | 150 | if [ -n "$IDENTIFIER" ]; then |
147 | 151 | attempts=0 |
148 | 152 | # shellcheck disable=SC2143 |
@@ -171,8 +175,8 @@ if [ -n "$IDENTIFIER" ]; then |
171 | 175 |
|
172 | 176 | # remove s3 storage |
173 | 177 | attempts=0 |
174 | | - # shellcheck disable=SC2143 |
175 | 178 | ID="$(aws s3 ls | grep -i "$IDENTIFIER" | awk '{print $3}')" |
| 179 | + # shellcheck disable=SC2143 |
176 | 180 | while [ -n "$(aws s3 ls | grep -i "$IDENTIFIER")" ] && [ $attempts -lt 3 ]; do |
177 | 181 | echo "found s3 bucket $ID, removing..." |
178 | 182 | while read -r v; do |
@@ -202,11 +206,11 @@ if [ -n "$IDENTIFIER" ]; then |
202 | 206 | while read -r line; do |
203 | 207 | if [ -z "$line" ]; then continue; fi |
204 | 208 | echo "removing load balancer target group, $line..." |
205 | | - aws elbv2 delete-target-group --target-group-arn $line; |
| 209 | + aws elbv2 delete-target-group --target-group-arn "$line"; |
206 | 210 | done <<<"$( |
207 | 211 | while read -r line; do |
208 | 212 | if [ -z "$line" ]; then continue; fi |
209 | | - aws elbv2 describe-tags --resource-arns $line | jq -r --arg id "$IDENTIFIER" '.TagDescriptions[] | select(any(.Tags[]; .Key == "Id" and .Value == $id)) | .ResourceArn // ""'; |
| 213 | + aws elbv2 describe-tags --resource-arns "$line" | jq -r --arg id "$IDENTIFIER" '.TagDescriptions[] | select(any(.Tags[]; .Key == "Id" and .Value == $id)) | .ResourceArn // ""'; |
210 | 214 | done <<<"$(aws elbv2 describe-target-groups | jq -r '.TargetGroups[]?.TargetGroupArn')" |
211 | 215 | )" |
212 | 216 | sleep 10 |
|
0 commit comments