Skip to content

Commit

Permalink
Kylesomers/packer ci (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylesomers authored Jun 23, 2024
1 parent aa7e2eb commit 5142847
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/packer-daily-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_CI_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-session-name: CGDToolkitGitHubActions
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
with:
Expand All @@ -52,17 +53,21 @@ jobs:
unzip awscliv2.zip
sudo ./aws/install --update
aws --version
echo ${AWS_PROFILE_CI}
- name: Install Packer
run: |
PACKER_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/packer | jq -r -M '.current_version')
wget https://releases.hashicorp.com/packer/${PACKER_VERSION}/packer_${PACKER_VERSION}_linux_amd64.zip
unzip packer_${PACKER_VERSION}_linux_amd64.zip
mv packer /usr/local/bin
rm packer_${PACKER_VERSION}_linux_amd64.zip
- name: Packer Validate and Build
- name: Packer Init and Validate
working-directory: ./assets/packer/${{ matrix.dir }}
run: |
echo "Validating Packer template: ${{ matrix.description }} - ${{ matrix.file_name }}"
packer init ${{ matrix.file_name }}
packer validate -var 'region="${{ vars.AWS_REGION }}"' -var 'vpc_id="${{ secrets.AWS_VPC_ID_CI }}"' -var 'subnet_id="${{ secrets.AWS_SUBNET_ID_CI }}"' -var 'public_key="${{ secrets.PACKER_CI_PUBLIC_KEY }}"' -var 'profile="${{ secrets.AWS_PROFILE_CI }}' ${{ matrix.file_name }}
- name: Packer Build
working-directory: ./assets/packer/${{ matrix.dir }}
run: |
packer build -var 'region="${{ vars.AWS_REGION }}"' -var 'vpc_id="${{ secrets.AWS_VPC_ID_CI }}"' -var 'subnet_id="${{ secrets.AWS_SUBNET_ID_CI }}"' -var 'public_key="${{ secrets.PACKER_CI_PUBLIC_KEY }}"' -var 'profile="${{ secrets.AWS_PROFILE_CI }}' ${{ matrix.file_name }}

0 comments on commit 5142847

Please sign in to comment.