tart-macos-image-templates/README.md

36 lines
1.4 KiB
Markdown

# osx-images
Packer templates to build [macOS Anka images](https://veertu.com/anka-technology/) to use in CI:
* `mojave-base` image has only `brew` pre-installed
* `mojave-xcode-10.1` image is based of `mojave-base` and has only `Xcode 10.1` pre-installed
* `mojave-xcode-10.2` image is based of `mojave-base` and has only `Xcode 10.2` pre-installed
* `mojave-xcode-10.3` image is based of `mojave-base` and has only `Xcode 10.3` pre-installed
* `mojave-xcode-11` image is based of `mojave-base` and has only `Xcode 11 GM` pre-installed
* `mojave-flutter` image is based of `mojave-xcode-11` and has only [`Flutter`](https://flutter.dev/) pre-installed
# Building Base Image
First, run `./scripts/install-anka-builder.sh` to install Anka builder for Packer.
To build the base image (you need to have `/Applications/Install macOS High Sierra.app/` installed from App Store):
```bash
packer build templates/mojave-base.json
```
We also need to add a port forwarding rule so VMs based of `mojave-base` image can be SSHable:
```bash
anka modify mojave-base add port-forwarding --host-port 0 --guest-port 22 --protocol tcp ssh
```
# Building Xcode Images
To build an Xcode image (don't forget to setup `FASTLANE_USER` and `FASTLANE_PASSWORD` since they are required by
[xcode-install](https://github.com/KrauseFx/xcode-install#usage)):
```bash
packer build -var xcode_version="10.3" templates/mojave-xcode.json
```