Make sure `/Users/runner` exists in `xcode` variant (#152)

A follow-up to #145. It seems right now only base variant preserves the symlink. `xcode` and `runner` are missing it and my guess it's due to disk resizing.

This change adds a validation script, so we verify `/Users/runner` folder exists in every variant.
This commit is contained in:
Fedor Korotkov 2024-05-13 07:56:29 -04:00 committed by GitHub
parent d594e1add0
commit 6f7ef84825
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 2 deletions

View File

@ -21,5 +21,5 @@ packer build -var macos_version=sonoma templates/base.pkr.hcl
## Building Xcode Image
```bash
packer build -var macos_version=sonoma -var xcode_version=15.3 templates/xcode.pkr.hcl
packer build -var macos_version=sonoma -var xcode_version="[15.3]" templates/xcode.pkr.hcl
```

View File

@ -121,4 +121,12 @@ build {
provisioner "shell" {
script = "scripts/automationmodetool.expect"
}
// some other health checks
provisioner "shell" {
inline = [
"source ~/.zprofile",
"test -d /Users/runner"
]
}
}

View File

@ -60,6 +60,13 @@ build {
script = "scripts/install-actions-runner.sh"
}
// make sure our workaround from base is still valid
provisioner "shell" {
inline = [
"sudo ln -s /Users/admin /Users/runner || true"
]
}
provisioner "shell" {
inline = [
"source ~/.zprofile",
@ -158,7 +165,7 @@ build {
]
}
// check there is at least 20GB of free space and fail if not
// check there is at least 15GB of free space and fail if not
provisioner "shell" {
inline = [
"source ~/.zprofile",
@ -167,4 +174,12 @@ build {
"[[ $FREE_MB -gt 15000 ]] && echo OK || exit 1"
]
}
// some other health checks
provisioner "shell" {
inline = [
"source ~/.zprofile",
"test -d /Users/runner"
]
}
}