Skip to content

Commit 0df3526

Browse files
committed
fox: use ami name
1 parent 9d2599d commit 0df3526

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/testinfra-nix.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,11 @@ jobs:
5353
GIT_SHA=${{github.sha}}
5454
packer build -var "git-head-version=${GIT_SHA}" -var "packer-execution-id=${GITHUB_RUN_ID}" -var-file="development-arm.vars.pkr.hcl" -var-file="common-nix.vars.pkr.hcl" -var "postgres-version=${{ steps.random.outputs.random_string }}" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" -var "git_sha=${GITHUB_SHA}" stage2-nix-psql.pkr.hcl
5555
56-
- name: Get pre-resize AMI ID
57-
id: get-ami
58-
run: |
59-
AMI_ID=$(aws ec2 describe-images --owners self --filters "Name=name,Values=supabase-postgres-${{ steps.random.outputs.random_string }}-pre-resize" --query 'Images[0].ImageId' --output text)
60-
echo "AMI_ID=${AMI_ID}" >> $GITHUB_OUTPUT
61-
6256
- name: Launch temporary instance
6357
id: launch-instance
6458
run: |
65-
INSTANCE_ID=$(aws ec2 run-instances --image-id ${{ steps.get-ami.outputs.AMI_ID }} --instance-type t4g.micro --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=AMI-Resize-Temp}]' --query 'Instances[0].InstanceId' --output text)
59+
AMI_NAME="supabase-postgres-${{ steps.random.outputs.random_string }}-pre-resize"
60+
INSTANCE_ID=$(aws ec2 run-instances --image-id $(aws ec2 describe-images --owners self --filters "Name=name,Values=${AMI_NAME}" --query 'Images[0].ImageId' --output text) --instance-type t4g.micro --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=AMI-Resize-Temp}]' --query 'Instances[0].InstanceId' --output text)
6661
echo "INSTANCE_ID=${INSTANCE_ID}" >> $GITHUB_OUTPUT
6762
6863
- name: Wait for instance to be running

0 commit comments

Comments
 (0)