Skip to content

Commit

Permalink
packer: auto rebuild base image for intel (#3650)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams authored Jul 3, 2024
1 parent 4b3b5ae commit 010f7a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ jobs:
- name: Init Packer
run: packer init orka.pkr.hcl
working-directory: ansible/packer

- name: Run Packer (base image)
# Skip arm64 for now as Xcode download takes too long
if: matrix.os != 'sonoma-arm64'
run: packer build --only=macstadium-orka.${{ matrix.os }} orka-base.pkr.hcl
working-directory: ansible/packer

- name: Run Packer
- name: Run Packer (final image)
run: packer build --only=macstadium-orka.${{ matrix.os }} orka.pkr.hcl
working-directory: ansible/packer
env:
Expand Down
6 changes: 5 additions & 1 deletion ansible/packer/orka-base.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ build {
}

# Pause the provisioner until user interacts (for install Xcode etc)
provisioner "breakpoint" {}
provisioner "breakpoint" {
only = ["macstadium-orka.sonoma-arm64"]
}

# Install homebrew and ansible
provisioner "shell" {
Expand All @@ -85,6 +87,8 @@ EOF

# Install Xcode
provisioner "ansible-local" {
# We only install Xcode on the arm64 VM (build tools is enough for the Intel test VMs)
only = ["macstadium-orka.sonoma-arm64"]
playbook_file = "../playbooks/AdoptOpenJDK_Unix_Playbook/main.yml"
playbook_dir = "../playbooks/AdoptOpenJDK_Unix_Playbook"
extra_arguments = [
Expand Down
2 changes: 2 additions & 0 deletions ansible/packer/orka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ build {

# Ensure ansible package is up to date
provisioner "shell" {
# Only needed on arm64 as we rebuild intel base frequently
only = ["macstadium-orka.sonoma-arm64"]
inline = [
"source /Users/admin/.zprofile; brew upgrade ansible",
]
Expand Down

0 comments on commit 010f7a3

Please sign in to comment.