File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -132,3 +132,8 @@ jobs:
132
132
if : ${{ cancelled() }}
133
133
run : |
134
134
aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --instance-ids {}
135
+
136
+ # - name: Cleanup resources on build cancellation
137
+ # if: ${{ always() }}
138
+ # run: |
139
+ # aws ec2 --region ap-southeast-1 describe-instances --filters "Name=tag:testinfra-run-id,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -I {} aws ec2 terminate-instances --instance-ids {}
Original file line number Diff line number Diff line change 1
1
import base64
2
2
import boto3
3
3
import gzip
4
+ import os
4
5
import pytest
5
6
import requests
6
7
import testinfra
7
8
from ec2instanceconnectcli .EC2InstanceConnectLogger import EC2InstanceConnectLogger
8
9
from ec2instanceconnectcli .EC2InstanceConnectKey import EC2InstanceConnectKey
9
10
from time import sleep
10
11
12
+ RUN_ID = os .environ ["GITHUB_RUN_ID" ] if os .environ ["GITHUB_RUN_ID" ] else "unknown-ci-run"
13
+
11
14
postgresql_schema_sql_content = """
12
15
ALTER DATABASE postgres SET "app.settings.jwt_secret" TO 'my_jwt_secret_which_is_not_so_secret';
13
16
ALTER DATABASE postgres SET "app.settings.jwt_exp" TO 3600;
@@ -211,7 +214,8 @@ def gzip_then_base64_encode(s: str) -> str:
211
214
"ResourceType" : "instance" ,
212
215
"Tags" : [
213
216
{"Key" : "Name" , "Value" : "ci-ami-test" },
214
- {"Key" : "creator" , "Value" : "testinfra-ci" }
217
+ {"Key" : "creator" , "Value" : "testinfra-ci" },
218
+ {"Key" : "testinfra-run-id" , "Value" : RUN_ID }
215
219
],
216
220
}
217
221
],
You can’t perform that action at this time.
0 commit comments