@@ -67,39 +67,28 @@ jobs:
67
67
68
68
- id : version
69
69
run : echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT"
70
- - name : Build Postgres deb
71
- uses : docker/build-push-action@v5
72
- with :
73
- file : docker/Dockerfile
74
- target : pg-deb
75
- build-args : |
76
- ubuntu_release=${{ matrix.ubuntu_release }}
77
- ubuntu_release_no=${{ matrix.ubuntu_version }}
78
- postgresql_major=${{ steps.version.outputs.postgresql_major }}
79
- postgresql_release=${{ steps.version.outputs.postgresql_release }}
80
- CPPFLAGS=-mcpu=${{ matrix.mcpu }}
81
- tags : supabase/postgres:deb
82
- platforms : linux/${{ matrix.arch }}
83
- outputs : type=tar,dest=/tmp/pg-deb.tar
84
- cache-from : type=gha,scope=${{ github.ref_name }}-deb
85
- cache-to : type=gha,mode=max,scope=${{ github.ref_name }}-deb
70
+ # - name: Build Postgres deb
71
+ # uses: docker/build-push-action@v5
72
+ # with:
73
+ # file: docker/Dockerfile
74
+ # target: pg-deb
75
+ # build-args: |
76
+ # ubuntu_release=${{ matrix.ubuntu_release }}
77
+ # ubuntu_release_no=${{ matrix.ubuntu_version }}
78
+ # postgresql_major=${{ steps.version.outputs.postgresql_major }}
79
+ # postgresql_release=${{ steps.version.outputs.postgresql_release }}
80
+ # CPPFLAGS=-mcpu=${{ matrix.mcpu }}
81
+ # tags: supabase/postgres:deb
82
+ # platforms: linux/${{ matrix.arch }}
83
+ # outputs: type=tar,dest=/tmp/pg-deb.tar
84
+ # cache-from: type=gha,scope=${{ github.ref_name }}-deb
85
+ # cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-deb
86
86
# - name: Extract Postgres deb
87
87
# run: |
88
88
# mkdir -p ansible/files/postgres
89
89
# tar xvf /tmp/pg-deb.tar -C ansible/files/postgres --strip-components 1
90
90
# TODO remove this block as deb is build in nix prior to this step
91
91
92
- - name : Build AMI stage 1
93
- run : |
94
- packer init amazon-arm64-nix.pkr.hcl
95
- GIT_SHA=${{github.sha}}
96
- 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 "ansible_arguments=" amazon-arm64-nix.pkr.hcl
97
-
98
- - name : Build AMI stage 1
99
- run : |
100
- packer init amazon-arm64-nix.pkr.hcl
101
- GIT_SHA=${{github.sha}}
102
- 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 "ansible_arguments=" amazon-arm64-nix.pkr.hcl
103
92
104
93
- name : Grab release version
105
94
id : process_release_version
108
97
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
109
98
110
99
- name : configure aws credentials - staging
111
- uses : aws-actions/configure-aws-credentials@v1
100
+ uses : aws-actions/configure-aws-credentials@v4
112
101
with :
113
102
role-to-assume : ${{ secrets.DEV_AWS_ROLE }}
114
103
aws-region : " us-east-1"
@@ -127,7 +116,7 @@ jobs:
127
116
# #TODO look to see if this only pg binaries and if so, remove this as it is covered by nix build
128
117
# TODO deactivate this block to assure binaries from this file are not uploaded. This is covered by nix build
129
118
- name : configure aws credentials - prod
130
- uses : aws-actions/configure-aws-credentials@v1
119
+ uses : aws-actions/configure-aws-credentials@v4
131
120
with :
132
121
role-to-assume : ${{ secrets.PROD_AWS_ROLE }}
133
122
aws-region : " us-east-1"
@@ -140,6 +129,32 @@ jobs:
140
129
-e "internal_artifacts_bucket=${{ secrets.PROD_ARTIFACTS_BUCKET }}" \
141
130
manifest-playbook.yml
142
131
132
+ - name : Build AMI stage 1
133
+ run : |
134
+ packer init amazon-arm64-nix.pkr.hcl
135
+ GIT_SHA=${{github.sha}}
136
+ 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 "ansible_arguments=" amazon-arm64-nix.pkr.hcl
137
+
138
+ - name : Set Environment Variables
139
+ id : set-env-vars
140
+ run : |
141
+ POSTGRES_VERSION=$(grep -oP '(?<=postgres-version = ").*(?=")' common-nix.vars.pkr.hcl)
142
+ echo "::set-output name=postgres-version::$POSTGRES_VERSION"
143
+
144
+ - name : Get AMI Owner
145
+ id : get-ami-owner
146
+ run : |
147
+ POSTGRES_VERSION="${{ steps.set-env-vars.outputs.postgres-version }}"
148
+ AMI_NAME="supabase-postgres-$POSTGRES_VERSION-stage-1"
149
+ OWNER=$(aws ec2 describe-images --filters "Name=name,Values=$AMI_NAME" "Name=state,Values=available" --query 'Images[].OwnerId' --output text)
150
+ echo "::set-output name=ami-owner::$OWNER"
151
+
152
+ - name : Build AMI stage 2
153
+ run : |
154
+ packer init stage2-nix-psql.pkr.hcl
155
+ GIT_SHA=${{github.sha}}
156
+ packer build -var "ami-owner-id=${OWNER}" -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" stage2-nix-psql.pkr.hcl
157
+
143
158
# - name: Upload pg binaries to s3 prod
144
159
# run: |
145
160
# 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
0 commit comments