Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ self-hosted-runner:
labels:
- aarch64-darwin
- aarch64-linux
- blacksmith-32vcpu-ubuntu-2404
- arm-native-runner
- blacksmith-2vcpu-ubuntu-2404
- blacksmith-2vcpu-ubuntu-2404-arm
- blacksmith-4vcpu-ubuntu-2404
- blacksmith-4vcpu-ubuntu-2404-arm
- blacksmith-8vcpu-ubuntu-2404
- blacksmith-32vcpu-ubuntu-2404
- large-linux-arm
- large-linux-x86
4 changes: 0 additions & 4 deletions .github/actionlint.yml

This file was deleted.

37 changes: 27 additions & 10 deletions .github/actions/build-ami/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ inputs:
arch:
description: Architecture to build AMI for (amd64|arm64)
required: true
force:
description: Force building stage1 AMI
required: false
git_sha:
description: 'Git SHA for this build'
required: true
Expand Down Expand Up @@ -49,9 +52,9 @@ runs:
id: set-execution-id
shell: bash
run: |
EXECUTION_ID="${{ github.run_id }}-${{ inputs.postgres_version }}-${{ inputs.arch }}"
echo "EXECUTION_ID=$EXECUTION_ID" >> $GITHUB_ENV
echo "execution_id=$EXECUTION_ID" >> $GITHUB_OUTPUT
PACKER_EXECUTION_ID="${{ github.run_id }}-${{ inputs.postgres_version }}-${{ inputs.arch }}"
echo "PACKER_EXECUTION_ID=$PACKER_EXECUTION_ID" >> $GITHUB_ENV
echo "execution_id=$PACKER_EXECUTION_ID" >> $GITHUB_OUTPUT

- name: Generate common-nix.vars.pkr.hcl
id: generate-vars
Expand All @@ -71,30 +74,44 @@ runs:
AWS_MAX_ATTEMPTS: 10
AWS_RETRY_MODE: adaptive
AWS_REGION: ${{ inputs.region }}
GIT_SHA: ${{ inputs.git_sha }}
run: |
echo "::group::AMI Build: Stage 1"

if [[ -n "${{ inputs.force }}" ]]; then
export BUILD_AMI_NIX_FORCE_BUILD_STAGE1="${{ inputs.force }}"
fi

nix run .#build-ami -- stage1 ${{ inputs.arch }} \
-var "git-head-version=${{ inputs.git_sha }}" \
-var "packer-execution-id=${{ env.EXECUTION_ID }}" \
-var "ansible_arguments=-e postgresql_major=${{ inputs.postgres_version }}" \
-var "ami_name=${{ inputs.ami_name_prefix }}" \
-var 'ami_regions=${{ inputs.ami_regions }}' \
-var "ansible_arguments=-e postgresql_major=${{ inputs.postgres_version }}" \
-var "git-head-version=${{ inputs.git_sha }}" \
-var "packer-execution-id=$PACKER_EXECUTION_ID" \
amazon-${{ inputs.arch }}-nix.pkr.hcl

echo "::endgroup::"

- name: Build AMI stage 2
id: build-stage2
shell: bash
env:
POSTGRES_MAJOR_VERSION: ${{ inputs.postgres_version }}
POSTGRES_VERSION: ${{ steps.generate-vars.outputs.version }}
PACKER_EXECUTION_ID: ${{ env.EXECUTION_ID }}
AWS_MAX_ATTEMPTS: 10
AWS_RETRY_MODE: adaptive
AWS_REGION: ${{ inputs.region }}
GIT_SHA: ${{ inputs.git_sha }}
run: |
echo "::group::AMI Build: Stage 2"

nix run .#build-ami -- stage2 ${{ inputs.arch }} \
-var "git-head-version=${{ inputs.git_sha }}" \
-var "packer-execution-id=${{ env.EXECUTION_ID }}" \
-var "postgres_major_version=${{ inputs.postgres_version }}" \
-var "ami_name=${{ inputs.ami_name_prefix }}" \
-var "git-head-version=${{ inputs.git_sha }}" \
-var "git_sha=${{ inputs.git_sha }}" \
-var "instance_type=${{ inputs.instance_type }}" \
-var "packer-execution-id=$PACKER_EXECUTION_ID" \
-var "postgres_major_version=${{ inputs.postgres_version }}" \
stage2-nix-psql.pkr.hcl

echo "::endgroup::"
Loading
Loading