Skip to content

Commit fe993bf

Browse files
committed
fix: declare different ami name prefix for test and release builds
In order to differentiate AMIs built for testing and those built for release, we need different AMI name. This commit introduces a new input parameter `ami_name_prefix`. For test builds, we set this prefix to include the GitHub run ID, ensuring uniqueness across test builds. For release builds, we use a static prefix "supabase-postgres".
1 parent 7f80702 commit fe993bf

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

.github/actions/build-ami/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
git_sha:
1515
description: 'Git SHA for this build'
1616
required: true
17+
ami_name_prefix:
18+
description: 'Prefix for the AMI name'
19+
required: false
20+
default: 'supabase-postgres'
1721

1822
outputs:
1923
stage2_ami_id:
@@ -63,7 +67,6 @@ runs:
6367
-var "region=${{ inputs.region }}" \
6468
-var 'ami_regions=${{ inputs.ami_regions }}' \
6569
-var-file="development-arm.vars.pkr.hcl" \
66-
-var-file="common-nix.vars.pkr.hcl" \
6770
amazon-arm64-nix.pkr.hcl
6871
6972
- name: Build AMI stage 2
@@ -82,7 +85,7 @@ runs:
8285
-var "postgres_major_version=${{ inputs.postgres_version }}" \
8386
-var-file="development-arm.vars.pkr.hcl" \
8487
-var-file="common-nix.vars.pkr.hcl" \
85-
-var "postgres-version=${{ env.EXECUTION_ID }}" \
88+
-var "ami_name=${{ inputs.ami_name_prefix }}" \
8689
-var 'ami_regions=${{ inputs.ami_regions }}' \
8790
-var "force-deregister=true" \
8891
-var "git_sha=${{ inputs.git_sha }}" \

.github/workflows/ami-release-nix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
-e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \
132132
-e "postgres_major_version=${{ matrix.postgres_version }}" \
133133
manifest-playbook.yml
134-
134+
135135
- name: Upload nix flake revision to s3 prod
136136
run: |
137137
aws s3 cp /tmp/pg_binaries.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz

.github/workflows/testinfra-ami-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ jobs:
9797
region: ap-southeast-1
9898
ami_regions: '["ap-southeast-1"]'
9999
git_sha: ${{ github.sha }}
100+
ami_name_prefix: "supabase-postgres-{{ github.run_id }}"
100101

101102
- name: Run tests
102103
timeout-minutes: 10

0 commit comments

Comments
 (0)