80 lines
2.2 KiB
HCL
80 lines
2.2 KiB
HCL
packer {
|
|
required_plugins {
|
|
tart = {
|
|
version = ">= 0.3.1"
|
|
source = "github.com/cirruslabs/tart"
|
|
}
|
|
}
|
|
}
|
|
|
|
variable "xcode_version" {
|
|
type = string
|
|
default = "13.4"
|
|
}
|
|
|
|
source "tart-cli" "tart" {
|
|
vm_base_name = "monterey-base"
|
|
vm_name = "monterey-xcode:${var.xcode_version}"
|
|
cpu_count = 4
|
|
memory_gb = 8
|
|
disk_size_gb = 70
|
|
ssh_password = "admin"
|
|
ssh_username = "admin"
|
|
ssh_timeout = "120s"
|
|
}
|
|
|
|
build {
|
|
sources = ["source.tart-cli.tart"]
|
|
|
|
provisioner "shell" {
|
|
inline = [
|
|
"source ~/.zprofile",
|
|
"brew --version",
|
|
"brew update",
|
|
"brew upgrade",
|
|
"brew install curl wget unzip zip ca-certificates",
|
|
"sudo softwareupdate --install-rosetta --agree-to-license"
|
|
]
|
|
}
|
|
provisioner "shell" {
|
|
inline = [
|
|
"echo 'export PATH=/usr/local/bin/:$PATH' >> ~/.zprofile",
|
|
"source ~/.zprofile",
|
|
"wget --quiet https://github.com/RobotsAndPencils/xcodes/releases/latest/download/xcodes.zip",
|
|
"unzip xcodes.zip",
|
|
"rm xcodes.zip",
|
|
"chmod +x xcodes",
|
|
"sudo mkdir -p /usr/local/bin/",
|
|
"sudo mv xcodes /usr/local/bin/xcodes",
|
|
"xcodes version",
|
|
"wget --quiet https://storage.googleapis.com/xcodes-cache/Xcode_${var.xcode_version}.xip",
|
|
"xcodes install ${var.xcode_version} --experimental-unxip --path $PWD/Xcode_${var.xcode_version}.xip",
|
|
"sudo rm -rf ~/.Trash/*",
|
|
"xcodes select ${var.xcode_version}",
|
|
"sudo xcodebuild -runFirstLaunch",
|
|
]
|
|
}
|
|
provisioner "shell" {
|
|
inline = [
|
|
"source ~/.zprofile",
|
|
"echo 'export FLUTTER_HOME=$HOME/flutter' >> ~/.zprofile",
|
|
"echo 'export PATH=$HOME/flutter:$HOME/flutter/bin/:$HOME/flutter/bin/cache/dart-sdk/bin:$PATH' >> ~/.zprofile",
|
|
"source ~/.zprofile",
|
|
"git clone https://github.com/flutter/flutter.git $FLUTTER_HOME",
|
|
"cd $FLUTTER_HOME",
|
|
"git checkout stable",
|
|
"flutter doctor",
|
|
"flutter precache",
|
|
]
|
|
}
|
|
provisioner "shell" {
|
|
inline = [
|
|
"source ~/.zprofile",
|
|
"brew install libimobiledevice ideviceinstaller ios-deploy fastlane",
|
|
"sudo gem update",
|
|
"sudo gem install cocoapods",
|
|
"sudo gem uninstall --ignore-dependencies ffi && sudo gem install ffi -- --enable-libffi-alloc"
|
|
]
|
|
}
|
|
}
|