File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 id : generate-vars
4646 shell : bash
4747 run : |
48- PG_VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres${{ inputs.postgres_version }}"]' ansible/vars.yml)
48+ PG_VERSION=$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres${{ inputs.postgres_version }}"]' ansible/vars.yml)
4949 echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl
5050 echo "" >> common-nix.vars.pkr.hcl
5151 git add -f common-nix.vars.pkr.hcl
Original file line number Diff line number Diff line change 3131 - name : Set PostgreSQL versions
3232 id : set-versions
3333 run : |
34- VERSIONS=$(nix run nixpkgs#yq -- -r '.postgres_major[] ' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]' )
34+ VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
3535 echo "postgres_versions=$VERSIONS" >> "$GITHUB_OUTPUT"
3636
3737 build :
7171
7272 - name : Generate common-nix.vars.pkr.hcl
7373 run : |
74- PG_VERSION="$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)"
74+ PG_VERSION="$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)"
7575 echo "postgres-version = \"$PG_VERSION\"" > common-nix.vars.pkr.hcl
7676
7777 - name : Build AMI stage 1
Original file line number Diff line number Diff line change 99
1010permissions :
1111 id-token : write
12-
12+
1313jobs :
1414 prepare :
1515 runs-on : blacksmith-2vcpu-ubuntu-2404
2424 - name : Set PostgreSQL versions
2525 id : set-versions
2626 run : |
27- VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[] ' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]' )
27+ VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
2828 echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
2929
3030 publish-staging :
4343 - name : Grab release version
4444 id : process_release_version
4545 run : |
46- VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
46+ VERSION=$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
4747 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
4848 echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT"
4949
9191 - name : Grab release version
9292 id : process_release_version
9393 run : |
94- VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
94+ VERSION=$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
9595 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
9696 echo "major_version=$(echo $VERSION | cut -d'.' -f1)" >> "$GITHUB_OUTPUT"
9797
@@ -107,7 +107,7 @@ jobs:
107107 with :
108108 role-to-assume : ${{ secrets.PROD_AWS_ROLE }}
109109 aws-region : " us-east-1"
110-
110+
111111 - name : Upload pg_upgrade scripts to s3 prod
112112 run : |
113113 aws s3 cp /tmp/pg_upgrade_bin.tar.gz s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/20.04.tar.gz
Original file line number Diff line number Diff line change 1616
1717permissions :
1818 id-token : write
19-
19+
2020jobs :
2121 prepare :
2222 runs-on : blacksmith-2vcpu-ubuntu-2404
2929 - name : Set PostgreSQL versions
3030 id : set-versions
3131 run : |
32- VERSIONS=$(nix run nixpkgs#yq -- '.postgres_major[] ' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c 'split("\n")[:-1]' )
32+ VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
3333 echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
3434
3535 publish-staging :
4848 - name : Grab release version
4949 id : process_release_version
5050 run : |
51- VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
51+ VERSION=$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
5252 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
5353
5454 - name : Create a tarball containing pg_upgrade scripts
9595 - name : Grab release version
9696 id : process_release_version
9797 run : |
98- VERSION=$(nix run nixpkgs#yq -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
98+ VERSION=$(nix run nixpkgs#yq-go -- -r '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
9999 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
100100
101101 - name : Create a tarball containing pg_upgrade scripts
@@ -109,7 +109,7 @@ jobs:
109109 with :
110110 role-to-assume : ${{ secrets.PROD_AWS_ROLE }}
111111 aws-region : " us-east-1"
112-
112+
113113 - name : Upload pg_upgrade scripts to s3 prod
114114 run : |
115115 aws s3 cp /tmp/pg_upgrade_scripts.tar.gz "s3://${{ secrets.PROD_ARTIFACTS_BUCKET }}/upgrades/postgres/supabase-postgres-${{ steps.process_release_version.outputs.version }}/pg_upgrade_scripts.tar.gz"
Original file line number Diff line number Diff line change 2929 - name : Set PostgreSQL versions - only builds pg17 atm
3030 id : set-versions
3131 run : |
32- VERSIONS=$(yq ' .postgres_major[1]' ansible/vars.yml | jq -R -s -c 'split("\n")[:-1]' )
32+ VERSIONS=$(yq -o=json -I=0 '[ .postgres_major[1]] ' ansible/vars.yml)
3333 echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
3434
3535 build :
Original file line number Diff line number Diff line change 1919 - name : Set PostgreSQL versions
2020 id : set-versions
2121 run : |
22- VERSIONS=$(nix run nixpkgs#yq -- -r '.postgres_major[] ' ansible/vars.yml | nix run nixpkgs#jq -- -R -s -c "split(\"\n\")[:-1]" )
22+ VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
2323 echo "postgres_versions=$VERSIONS" >> $GITHUB_OUTPUT
2424 build :
2525 needs : prepare
4848 echo "PGMAJOR=$stripped_version" >> $GITHUB_ENV
4949 - name : Generate common-nix.vars.pkr.hcl
5050 run : |
51- PG_VERSION=$(nix run nixpkgs#yq -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
51+ PG_VERSION=$(nix run nixpkgs#yq-go -- '.postgres_release["postgres'${{ matrix.postgres_version }}'"]' ansible/vars.yml)
5252 PG_VERSION=$(echo $PG_VERSION | tr -d '"') # Remove any surrounding quotes
5353 echo 'postgres-version = "'$PG_VERSION'"' > common-nix.vars.pkr.hcl
5454 echo "" >> common-nix.vars.pkr.hcl
5757 - name : Generate args
5858 id : args
5959 run : |
60- ARGS=$(nix run nixpkgs#yq -- 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' ansible/vars.yml)
60+ ARGS=$(nix run nixpkgs#yq-go -- 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' ansible/vars.yml)
6161 echo "result<<EOF" >> $GITHUB_OUTPUT
6262 echo "$ARGS" >> $GITHUB_OUTPUT
6363 echo "EOF" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change 3030 - name : Set PostgreSQL versions
3131 id : set-versions
3232 run : |
33- VERSIONS=$(nix run nixpkgs#yq -- -r '.postgres_major[] ' ansible/vars.yml | nix run nixpkgs#jq -- -R -r -s -c 'split("\n")[:-1]' )
33+ VERSIONS=$(nix run nixpkgs#yq-go -- -o=json -I=0 '.postgres_major' ansible/vars.yml)
3434 echo "postgres_versions=$VERSIONS" >> "$GITHUB_OUTPUT"
3535
3636 test-ami-nix :
You can’t perform that action at this time.
0 commit comments