From d6ddbcd278fd03cec014d3596dce618cca969046 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Mon, 25 Apr 2022 23:09:04 +0400 Subject: [PATCH] Install Xcodeclt & Homebrew first (#5430) --- images/macos/templates/macOS-10.15.json | 11 +++++++++-- images/macos/templates/macOS-11.json | 9 ++++++++- images/macos/templates/macOS-11.pkr.hcl | 7 ++++++- images/macos/templates/macOS-12.json | 10 ++++++++-- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/images/macos/templates/macOS-10.15.json b/images/macos/templates/macOS-10.15.json index 9d051353..201bb31d 100644 --- a/images/macos/templates/macOS-10.15.json +++ b/images/macos/templates/macOS-10.15.json @@ -90,9 +90,17 @@ }, { "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "pause_before": "30s", "scripts": [ "./provision/core/xcode-clt.sh", + "./provision/core/homebrew.sh" + ] + }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}", + "scripts": [ "./provision/configuration/add-network-interface-detection.sh", "./provision/configuration/autologin.sh", "./provision/configuration/disable-auto-updates.sh", @@ -130,7 +138,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ - "./provision/core/homebrew.sh", "./provision/core/open_windows_check.sh", "./provision/core/powershell.sh", "./provision/core/dotnet.sh", diff --git a/images/macos/templates/macOS-11.json b/images/macos/templates/macOS-11.json index a62b26a9..684e3d46 100644 --- a/images/macos/templates/macOS-11.json +++ b/images/macos/templates/macOS-11.json @@ -93,6 +93,14 @@ "source": "./toolsets/toolset-11.json", "destination": "~/image-generation/toolset.json" }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", + "scripts": [ + "./provision/core/xcode-clt.sh", + "./provision/core/homebrew.sh" + ] + }, { "type": "shell", "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}", @@ -135,7 +143,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ - "./provision/core/homebrew.sh", "./provision/core/open_windows_check.sh", "./provision/core/powershell.sh", "./provision/core/dotnet.sh", diff --git a/images/macos/templates/macOS-11.pkr.hcl b/images/macos/templates/macOS-11.pkr.hcl index bbc65e2b..cd4db2c0 100644 --- a/images/macos/templates/macOS-11.pkr.hcl +++ b/images/macos/templates/macOS-11.pkr.hcl @@ -99,6 +99,12 @@ build { provisioner "shell" { scripts = [ "./provision/core/xcode-clt.sh", + "./provision/core/homebrew.sh" + ] + execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}" + } + provisioner "shell" { + scripts = [ "./provision/configuration/configure-tccdb-macos11.sh", "./provision/configuration/add-network-interface-detection.sh", "./provision/configuration/autologin.sh", @@ -134,7 +140,6 @@ build { provisioner "shell" { pause_before = "30s" scripts = [ - "./provision/core/homebrew.sh", "./provision/core/open_windows_check.sh", "./provision/core/powershell.sh", "./provision/core/dotnet.sh", diff --git a/images/macos/templates/macOS-12.json b/images/macos/templates/macOS-12.json index e9117a80..19cacb0e 100644 --- a/images/macos/templates/macOS-12.json +++ b/images/macos/templates/macOS-12.json @@ -95,9 +95,16 @@ }, { "type": "shell", - "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}", + "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "scripts": [ "./provision/core/xcode-clt.sh", + "./provision/core/homebrew.sh" + ] + }, + { + "type": "shell", + "execute_command": "chmod +x {{ .Path }}; sudo {{ .Vars }} {{ .Path }}", + "scripts": [ "./provision/configuration/add-network-interface-detection.sh", "./provision/configuration/autologin.sh", "./provision/configuration/disable-auto-updates.sh", @@ -136,7 +143,6 @@ "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} {{ .Path }}", "pause_before": "30s", "scripts": [ - "./provision/core/homebrew.sh", "./provision/core/open_windows_check.sh", "./provision/core/powershell.sh", "./provision/core/dotnet.sh",