From 9bcea09be34089a7e0d1ec14a63d1a1d63074e84 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 10:00:33 -0800 Subject: [PATCH 1/7] Explicitly set required plugin versions. Packer update no longer allows bundled plugins. --- .github/workflows/packer-ghar.yml | 1 + packer/github-action-runner/variables.pkr.hcl | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index b17b7cf74..a4016b334 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -1,5 +1,6 @@ name: Build GHAR on: + pull_request: schedule: - cron: '30 5 1,15 * *' workflow_dispatch: diff --git a/packer/github-action-runner/variables.pkr.hcl b/packer/github-action-runner/variables.pkr.hcl index c74667534..12ef17e1d 100644 --- a/packer/github-action-runner/variables.pkr.hcl +++ b/packer/github-action-runner/variables.pkr.hcl @@ -1,3 +1,12 @@ +packer { + required_plugins { + amazon = { + version = ">= 1.1.0" + source = "github.com/hashicorp/amazon" + } + } +} + variable "skip_ami" { type = bool default = true From 574f2835c7cf42c96e3a937fc464a1cfabe26ba6 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 10:36:42 -0800 Subject: [PATCH 2/7] Add a path to download artifact --- .github/workflows/packer-ghar.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index a4016b334..538d27e08 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -131,6 +131,7 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: manifest + path: ${{ matrix.build_location }}/manifest.json - name: get ami ID from manifest run: echo "AMI_ID=$(cat manifest.json |jq -r .builds[].artifact_id|awk -F":" '{print $2}')" >> $GITHUB_ENV - name: Update Launch Templates From ac08aebde3fa0b58f8de43fb695d565cbd6cf0b6 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 10:46:43 -0800 Subject: [PATCH 3/7] Add a path to download artifact --- .github/workflows/packer-ghar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index 538d27e08..d68438aab 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -91,7 +91,7 @@ jobs: uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: manifest - path: ${{ matrix.build_location }}/manifest.json + path: packer/github-action-runner/manifest.json - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest with: ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN From 9707d2c4d21cf63e5d0f7537ed97f52222a80d64 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 10:56:05 -0800 Subject: [PATCH 4/7] Add a path to download artifact --- .github/workflows/packer-ghar.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index d68438aab..20e5d5971 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -91,7 +91,7 @@ jobs: uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: manifest - path: packer/github-action-runner/manifest.json + path: ${{ matrix.build_location }}/manifest.json - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest with: ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN @@ -131,7 +131,7 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: manifest - path: ${{ matrix.build_location }}/manifest.json + path: packer/github-action-runner/manifest.json - name: get ami ID from manifest run: echo "AMI_ID=$(cat manifest.json |jq -r .builds[].artifact_id|awk -F":" '{print $2}')" >> $GITHUB_ENV - name: Update Launch Templates From 1c4c53cb067f33ae55fbff4e2fbb8b9187b40694 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 11:31:51 -0800 Subject: [PATCH 5/7] Change back the download artifact step --- .github/workflows/packer-ghar.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index 20e5d5971..a5b6742b3 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -131,7 +131,6 @@ jobs: uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 with: name: manifest - path: packer/github-action-runner/manifest.json - name: get ami ID from manifest run: echo "AMI_ID=$(cat manifest.json |jq -r .builds[].artifact_id|awk -F":" '{print $2}')" >> $GITHUB_ENV - name: Update Launch Templates From f4376010a369f582d96b6de0e63739cd170442a8 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 11:39:32 -0800 Subject: [PATCH 6/7] Remove blank space --- .github/workflows/packer-ghar.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index a5b6742b3..a4016b334 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -91,7 +91,7 @@ jobs: uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 with: name: manifest - path: ${{ matrix.build_location }}/manifest.json + path: ${{ matrix.build_location }}/manifest.json - uses: department-of-veterans-affairs/action-inject-ssm-secrets@d8e6de3bde4dd728c9d732baef58b3c854b8c4bb # latest with: ssm_parameter: /devops/VA_VSP_BOT_GITHUB_TOKEN From 3b72c9da7045745011d34c46c761fe68699a2514 Mon Sep 17 00:00:00 2001 From: eric oliver Date: Mon, 18 Dec 2023 11:40:20 -0800 Subject: [PATCH 7/7] Remove run on pull_request --- .github/workflows/packer-ghar.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/packer-ghar.yml b/.github/workflows/packer-ghar.yml index a4016b334..b17b7cf74 100644 --- a/.github/workflows/packer-ghar.yml +++ b/.github/workflows/packer-ghar.yml @@ -1,6 +1,5 @@ name: Build GHAR on: - pull_request: schedule: - cron: '30 5 1,15 * *' workflow_dispatch: