Skip to content

Commit 972784c

Browse files
[Mac OS] Add template for Mac OS 14 image (#8733)
1 parent 5d6938f commit 972784c

File tree

2 files changed

+360
-0
lines changed

2 files changed

+360
-0
lines changed
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
packer {
2+
required_plugins {
3+
veertu-anka = {
4+
version = ">= v3.2.0"
5+
source = "github.com/veertuinc/veertu-anka"
6+
}
7+
}
8+
}
9+
10+
variable "source_vm_name" {
11+
type = string
12+
}
13+
14+
variable "source_vm_tag" {
15+
type = string
16+
}
17+
18+
variable "build_id" {
19+
type = string
20+
}
21+
22+
variable "vm_username" {
23+
type = string
24+
sensitive = true
25+
}
26+
27+
variable "vm_password" {
28+
type = string
29+
sensitive = true
30+
}
31+
32+
variable "github_api_pat" {
33+
type = string
34+
default = ""
35+
}
36+
37+
variable "xcode_install_storage_url" {
38+
type = string
39+
sensitive = true
40+
}
41+
42+
variable "xcode_install_sas" {
43+
type = string
44+
sensitive = true
45+
}
46+
47+
variable "vcpu_count" {
48+
type = string
49+
default = "6"
50+
}
51+
52+
variable "ram_size" {
53+
type = string
54+
default = "24G"
55+
}
56+
57+
variable "image_os" {
58+
type = string
59+
default = "macos14"
60+
}
61+
62+
source "veertu-anka-vm-clone" "template" {
63+
vm_name = "${var.build_id}"
64+
source_vm_name = "${var.source_vm_name}"
65+
source_vm_tag = "${var.source_vm_tag}"
66+
vcpu_count = "${var.vcpu_count}"
67+
ram_size = "${var.ram_size}"
68+
stop_vm = "true"
69+
}
70+
71+
build {
72+
sources = [
73+
"source.veertu-anka-vm-clone.template"
74+
]
75+
provisioner "shell" {
76+
inline = [
77+
"mkdir ~/image-generation"
78+
]
79+
}
80+
provisioner "file" {
81+
destination = "image-generation/"
82+
sources = [
83+
"./provision/assets",
84+
"./tests",
85+
"./software-report",
86+
"./helpers"
87+
]
88+
}
89+
provisioner "file" {
90+
destination = "image-generation/software-report/"
91+
source = "../../helpers/software-report-base"
92+
}
93+
provisioner "file" {
94+
destination = "image-generation/add-certificate.swift"
95+
source = "./provision/configuration/add-certificate.swift"
96+
}
97+
provisioner "file" {
98+
destination = ".bashrc"
99+
source = "./provision/configuration/environment/bashrc"
100+
}
101+
provisioner "file" {
102+
destination = ".bash_profile"
103+
source = "./provision/configuration/environment/bashprofile"
104+
}
105+
provisioner "file" {
106+
destination = "./"
107+
source = "./provision/utils"
108+
}
109+
provisioner "shell" {
110+
inline = [
111+
"mkdir ~/bootstrap"
112+
]
113+
}
114+
provisioner "file" {
115+
destination = "bootstrap"
116+
source = "./provision/bootstrap-provisioner/"
117+
}
118+
provisioner "file" {
119+
destination = "image-generation/toolset.json"
120+
source = "./toolsets/toolset-14.json"
121+
}
122+
provisioner "shell" {
123+
scripts = [
124+
"./provision/core/xcode-clt.sh",
125+
"./provision/core/homebrew.sh"
126+
]
127+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
128+
}
129+
provisioner "shell" {
130+
scripts = [
131+
"./provision/configuration/configure-tccdb-macos.sh",
132+
"./provision/configuration/disable-auto-updates.sh",
133+
"./provision/configuration/ntpconf.sh",
134+
"./provision/configuration/shell-change.sh"
135+
]
136+
environment_vars = [
137+
"PASSWORD=${var.vm_password}",
138+
"USERNAME=${var.vm_username}"
139+
]
140+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
141+
}
142+
provisioner "shell" {
143+
scripts = [
144+
"./provision/configuration/preimagedata.sh",
145+
"./provision/configuration/configure-ssh.sh",
146+
"./provision/configuration/configure-machine.sh"
147+
]
148+
environment_vars = [
149+
"IMAGE_VERSION=${var.build_id}",
150+
"IMAGE_OS=${var.image_os}",
151+
"PASSWORD=${var.vm_password}"
152+
]
153+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
154+
}
155+
provisioner "shell" {
156+
script = "./provision/core/reboot.sh"
157+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
158+
expect_disconnect = true
159+
}
160+
provisioner "shell" {
161+
pause_before = "30s"
162+
scripts = [
163+
"./provision/core/open_windows_check.sh",
164+
"./provision/core/powershell.sh",
165+
"./provision/core/mono.sh",
166+
"./provision/core/dotnet.sh",
167+
"./provision/core/python.sh",
168+
"./provision/core/azcopy.sh",
169+
"./provision/core/openssl.sh",
170+
"./provision/core/ruby.sh",
171+
"./provision/core/rubygem.sh",
172+
"./provision/core/git.sh",
173+
"./provision/core/node.sh",
174+
"./provision/core/commonutils.sh"
175+
]
176+
environment_vars = [
177+
"API_PAT=${var.github_api_pat}",
178+
"USER_PASSWORD=${var.vm_password}"
179+
]
180+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
181+
}
182+
provisioner "shell" {
183+
script = "./provision/core/xcode.ps1"
184+
environment_vars = [
185+
"XCODE_INSTALL_STORAGE_URL=${var.xcode_install_storage_url}",
186+
"XCODE_INSTALL_SAS=${var.xcode_install_sas}"
187+
]
188+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} pwsh -f {{ .Path }}"
189+
}
190+
provisioner "shell" {
191+
script = "./provision/core/reboot.sh"
192+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; sudo {{ .Vars }} {{ .Path }}"
193+
expect_disconnect = true
194+
}
195+
provisioner "shell" {
196+
scripts = [
197+
"./provision/core/action-archive-cache.sh",
198+
"./provision/core/llvm.sh",
199+
"./provision/core/swiftlint.sh",
200+
"./provision/core/openjdk.sh",
201+
"./provision/core/php.sh",
202+
"./provision/core/aws.sh",
203+
"./provision/core/rust.sh",
204+
"./provision/core/gcc.sh",
205+
"./provision/core/haskell.sh",
206+
"./provision/core/cocoapods.sh",
207+
"./provision/core/android-toolsets.sh",
208+
"./provision/core/apache.sh",
209+
"./provision/core/vcpkg.sh",
210+
"./provision/core/safari.sh",
211+
"./provision/core/chrome.sh",
212+
"./provision/core/edge.sh",
213+
"./provision/core/firefox.sh",
214+
"./provision/core/pypy.sh",
215+
"./provision/core/bicep.sh",
216+
"./provision/core/codeql-bundle.sh"
217+
]
218+
environment_vars = [
219+
"API_PAT=${var.github_api_pat}"
220+
]
221+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
222+
}
223+
provisioner "shell" {
224+
script = "./provision/core/delete-duplicate-sims.rb"
225+
execute_command = "source $HOME/.bash_profile; ruby {{ .Path }}"
226+
}
227+
provisioner "shell" {
228+
inline = [
229+
"pwsh -File \"$HOME/image-generation/software-report/SoftwareReport.Generator.ps1\" -OutputDirectory \"$HOME/image-generation/output/software-report\" -ImageName ${var.build_id}"
230+
]
231+
execute_command = "source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
232+
}
233+
provisioner "file" {
234+
destination = "../image-output/"
235+
direction = "download"
236+
source = "./image-generation/output/"
237+
}
238+
provisioner "shell" {
239+
scripts = [
240+
"./provision/configuration/configure-hostname.sh",
241+
"./provision/configuration/cleanup-brew.sh",
242+
"./provision/configuration/finalize-vm.sh"
243+
]
244+
execute_command = "chmod +x {{ .Path }}; source $HOME/.bash_profile; {{ .Vars }} {{ .Path }}"
245+
}
246+
}
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
{
2+
"xcode": {
3+
"default": "15.0.1",
4+
"x64": {
5+
"versions": [
6+
{ "link": "15.0.1", "version": "15.0.1+15A507", "symlinks": ["15.0"], "install_runtimes": "true"},
7+
{ "link": "14.3.1", "version": "14.3.1+14E300c","symlinks": ["14.3"], "install_runtimes": "true"}
8+
]
9+
}
10+
},
11+
"java": {
12+
"x64": {
13+
"default": "21",
14+
"versions": [ "8", "11", "17", "21"]
15+
}
16+
},
17+
"android": {
18+
"cmdline-tools": "commandlinetools-mac-10406996_latest.zip",
19+
"sdk-tools": "sdk-tools-darwin-4333796.zip",
20+
"platform_min_version": "33",
21+
"build_tools_min_version": "33.0.2",
22+
"extra-list": [
23+
"android;m2repository", "google;m2repository", "google;google_play_services"
24+
],
25+
"addon-list": [],
26+
"additional-tools": [
27+
"cmake;3.22.1"
28+
],
29+
"ndk": {
30+
"default": "26",
31+
"versions": [
32+
"24", "25", "26"
33+
]
34+
}
35+
},
36+
"powershellModules": [
37+
{ "name": "Az" },
38+
{ "name": "Pester" },
39+
{ "name": "PSScriptAnalyzer" }
40+
],
41+
"brew": {
42+
"common_packages": [
43+
"ant",
44+
"aria2",
45+
"azure-cli",
46+
"bazelisk",
47+
"carthage",
48+
"cmake",
49+
"gh",
50+
"gnupg",
51+
"gnu-tar",
52+
"kotlin",
53+
"libpq",
54+
"p7zip",
55+
"packer",
56+
"perl",
57+
"pkg-config",
58+
"swiftformat",
59+
"zstd",
60+
"gmp",
61+
"r",
62+
"yq",
63+
"unxip"
64+
],
65+
"cask_packages": [
66+
"julia"
67+
]
68+
},
69+
"gcc": {
70+
"versions": [
71+
"11",
72+
"12",
73+
"13"
74+
]
75+
},
76+
"dotnet": {
77+
"arch":{
78+
"x64": {
79+
"versions": [
80+
"7.0"
81+
]
82+
}
83+
}
84+
},
85+
"ruby": {
86+
"default": "3.0",
87+
"rubygems": [
88+
"cocoapods",
89+
"xcpretty",
90+
"bundler",
91+
"fastlane"
92+
]
93+
},
94+
"go": {
95+
"default": "1.20"
96+
},
97+
"node": {
98+
"default": "18"
99+
},
100+
"llvm": {
101+
"version": "15"
102+
},
103+
"php": {
104+
"version": "8.2"
105+
},
106+
"mono": {
107+
"framework":{
108+
"version": "6.12.0.188"
109+
},
110+
"nunit": {
111+
"version": "3.15.4"
112+
}
113+
}
114+
}

0 commit comments

Comments
 (0)