Skip to content

Commit

Permalink
chore: reenable disabled code
Browse files Browse the repository at this point in the history
  • Loading branch information
darora committed Nov 15, 2023
1 parent 8daf6d9 commit 14bd9a2
Showing 1 changed file with 76 additions and 76 deletions.
152 changes: 76 additions & 76 deletions .github/workflows/testinfra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,78 +49,78 @@ jobs:
- name: Checkout Repo
uses: actions/checkout@v4

# - id: args
# uses: mikefarah/yq@master
# with:
# cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml'

# - run: docker context create builders

# - uses: docker/setup-buildx-action@v3
# with:
# endpoint: builders

# - uses: docker/build-push-action@v5
# with:
# load: true
# build-args: |
# ${{ steps.args.outputs.result }}
# target: extensions
# tags: supabase/postgres:extensions
# platforms: linux/${{ matrix.arch }}
# cache-from: |
# type=gha,scope=${{ github.ref_name }}-extensions
# type=gha,scope=${{ github.base_ref }}-extensions
# type=gha,scope=develop-extensions
# cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-extensions

# - name: Extract built packages
# run: |
# mkdir -p /tmp/extensions ansible/files/extensions
# docker save supabase/postgres:extensions | tar xv -C /tmp/extensions
# for layer in /tmp/extensions/*/layer.tar; do
# tar xvf "$layer" -C ansible/files/extensions --strip-components 1
# done

# - id: version
# run: echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT"

# - name: Build Postgres deb
# uses: docker/build-push-action@v5
# with:
# load: true
# file: docker/Dockerfile
# target: pg-deb
# build-args: |
# ubuntu_release=${{ matrix.ubuntu_release }}
# ubuntu_release_no=${{ matrix.ubuntu_version }}
# postgresql_major=${{ steps.version.outputs.postgresql_major }}
# postgresql_release=${{ steps.version.outputs.postgresql_release }}
# CPPFLAGS=-mcpu=${{ matrix.mcpu }}
# tags: supabase/postgres:deb
# platforms: linux/${{ matrix.arch }}
# cache-from: |
# type=gha,scope=${{ github.ref_name }}-deb
# type=gha,scope=${{ github.base_ref }}-deb
# type=gha,scope=develop-deb
# cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-deb

# - name: Extract Postgres deb
# run: |
# mkdir -p /tmp/build ansible/files/postgres
# docker save supabase/postgres:deb | tar xv -C /tmp/build
# for layer in /tmp/build/*/layer.tar; do
# tar xvf "$layer" -C ansible/files/postgres --strip-components 1
# done

# # Packer doesn't support skipping registering the AMI for the ebssurrogate
# # builder, so we register an AMI with a fixed name and run tests on an
# # instance launched from that
# # https://github.com/hashicorp/packer/issues/4899
# - name: Build AMI
# run: |
# GIT_SHA=${{github.sha}}
# 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.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=ci-ami-test" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" amazon-arm64.pkr.hcl
- id: args
uses: mikefarah/yq@master
with:
cmd: yq 'to_entries | map(select(.value|type == "!!str")) | map(.key + "=" + .value) | join("\n")' 'ansible/vars.yml'

- run: docker context create builders

- uses: docker/setup-buildx-action@v3
with:
endpoint: builders

- uses: docker/build-push-action@v5
with:
load: true
build-args: |
${{ steps.args.outputs.result }}
target: extensions
tags: supabase/postgres:extensions
platforms: linux/${{ matrix.arch }}
cache-from: |
type=gha,scope=${{ github.ref_name }}-extensions
type=gha,scope=${{ github.base_ref }}-extensions
type=gha,scope=develop-extensions
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-extensions

- name: Extract built packages
run: |
mkdir -p /tmp/extensions ansible/files/extensions
docker save supabase/postgres:extensions | tar xv -C /tmp/extensions
for layer in /tmp/extensions/*/layer.tar; do
tar xvf "$layer" -C ansible/files/extensions --strip-components 1
done
- id: version
run: echo "${{ steps.args.outputs.result }}" | grep "postgresql" >> "$GITHUB_OUTPUT"

- name: Build Postgres deb
uses: docker/build-push-action@v5
with:
load: true
file: docker/Dockerfile
target: pg-deb
build-args: |
ubuntu_release=${{ matrix.ubuntu_release }}
ubuntu_release_no=${{ matrix.ubuntu_version }}
postgresql_major=${{ steps.version.outputs.postgresql_major }}
postgresql_release=${{ steps.version.outputs.postgresql_release }}
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
tags: supabase/postgres:deb
platforms: linux/${{ matrix.arch }}
cache-from: |
type=gha,scope=${{ github.ref_name }}-deb
type=gha,scope=${{ github.base_ref }}-deb
type=gha,scope=develop-deb
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-deb

- name: Extract Postgres deb
run: |
mkdir -p /tmp/build ansible/files/postgres
docker save supabase/postgres:deb | tar xv -C /tmp/build
for layer in /tmp/build/*/layer.tar; do
tar xvf "$layer" -C ansible/files/postgres --strip-components 1
done
# Packer doesn't support skipping registering the AMI for the ebssurrogate
# builder, so we register an AMI with a fixed name and run tests on an
# instance launched from that
# https://github.com/hashicorp/packer/issues/4899
- name: Build AMI
run: |
GIT_SHA=${{github.sha}}
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.vars.pkr.hcl" -var "ansible_arguments=" -var "postgres-version=ci-ami-test" -var "region=ap-southeast-1" -var 'ami_regions=["ap-southeast-1"]' -var "force-deregister=true" amazon-arm64.pkr.hcl
- name: Run tests
timeout-minutes: 5
Expand All @@ -134,7 +134,7 @@ jobs:
run: |
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 {}
# - name: Cleanup resources on build cancellation
# if: ${{ always() }}
# run: |
# 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 {}
- name: Cleanup resources on build cancellation
if: ${{ always() }}
run: |
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 {}

0 comments on commit 14bd9a2

Please sign in to comment.