Skip to content

Commit

Permalink
[macos] Convert packer templates to HCL2 (actions#9098)
Browse files Browse the repository at this point in the history
* [macos] Convert packer templates to HCL2

* Fix inline shell provisioner

* Fix folder name

* Fix bootstrap folder copy
  • Loading branch information
shamil-mubarakshin authored Jan 5, 2024
1 parent 9da2ec6 commit 4960fde
Show file tree
Hide file tree
Showing 9 changed files with 615 additions and 535 deletions.
2 changes: 1 addition & 1 deletion docs/create-image-and-azure-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The runner-images project uses [Packer](https://www.packer.io/) to generate disk images for Windows 2019/2022 and Ubuntu 20.04/22.04.

Each image is configured by a JSON or HCL2 Packer template that specifies where to build the image (Azure, in this case),
Each image is configured by a HCL2 Packer template that specifies where to build the image (Azure, in this case),
and what steps to run to install software and prepare the disk.

The Packer process initializes a connection to the Azure subscription using Azure CLI and creates temporary resources
Expand Down
3 changes: 1 addition & 2 deletions docs/debugging-failed-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Log into the Azure Portal. Find that resource group under `Resource groups`. Y
## Step 3: Connect to the VM
Select the VM in the resource group. Click `Connect:`

This will download an RDP file. Open that and enter the credentials found in the JSON file you pass to `packer build`:
This will download an RDP file. Open that and enter the credentials found in the HCL2 file you pass to `packer build`:

![VM credentials screenshot](/docs/resources/vmCredentials.png "VM credentials screenshot")

1 change: 1 addition & 0 deletions images.CI/macos/azure-pipelines/image-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ jobs:
'Using ssh communicator to connect:'
)
packer init ${{ parameters.template_path }}
packer build -on-error=abort `
-var="vcenter_server=$(vcenter-server-v2)" `
-var="vcenter_username=$(vcenter-username-v2)" `
Expand Down
2 changes: 1 addition & 1 deletion images.CI/macos/azure-pipelines/macos11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
parameters:
image_label: 'macOS Big Sur'
base_image_name: 'clean-macOS-11-380Gb-runner'
template_path: 'templates/macOS-11.json'
template_path: 'templates/macOS-11.pkr.hcl'
target_datastore: 'ds-image'
2 changes: 1 addition & 1 deletion images.CI/macos/azure-pipelines/macos12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
parameters:
image_label: 'macOS Monterey'
base_image_name: 'clean-macOS-12-380Gb-runner'
template_path: 'templates/macOS-12.json'
template_path: 'templates/macOS-12.pkr.hcl'
target_datastore: 'ds-image'
262 changes: 0 additions & 262 deletions images/macos/templates/macOS-11.json

This file was deleted.

Loading

0 comments on commit 4960fde

Please sign in to comment.