Skip to content

Commit 4f6dd45

Browse files
Merge pull request circleci#1759 from circleci/macos
Add reference for macOS executor syntax
2 parents 1a43593 + 2c8e051 commit 4f6dd45

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

jekyll/_cci2/configuration-reference.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Key | Required | Type | Description
5252
----|-----------|------|------------
5353
docker | Y <sup>(1)</sup> | List | Options for [docker executor](#docker)
5454
machine | Y <sup>(1)</sup> | Map | Options for [machine executor](#machine)
55+
macos | Y <sup>(1)</sup> | Map | Options for [macOS executor](#macos)
5556
shell | N | String | Shell to use for execution command in all steps. Can be overridden by `shell` in each step (default: See [Default Shell Options](#default-shell-options))
5657
steps | Y | List | A list of [steps](#steps) to be performed
5758
working_directory | N | String | In which directory to run the steps. (default: `~/project`. `project` is a literal string, not the name of the project.) You can also refer the directory with `$CIRCLE_WORKING_DIRECTORY` environment variable.
@@ -92,7 +93,7 @@ jobs:
9293
- run: make
9394
```
9495
95-
#### **`docker`** | **`machine`** (_executor_)
96+
#### **`docker`** / **`machine`** / **`macos`**(_executor_)
9697

9798
An "executor" is roughly "a place where steps occur". CircleCI 2.0 can build the necessary environment by launching as many docker containers as needed at once, or it can use a full virtual machine. Learn more about [different executors]({{ site.baseurl }}/2.0/executor-types/).
9899

@@ -222,6 +223,27 @@ jobs:
222223
image: circleci/classic:201708-01
223224
```
224225

226+
227+
#### **`macos`**
228+
{:.no_toc}
229+
230+
CircleCI supports running jobs on [macOS](https://developer.apple.com/macos/), to allow you to build, test, and deploy apps for macOS, [iOS](https://developer.apple.com/ios/), [tvOS](https://developer.apple.com/tvos/) and [watchOS](https://developer.apple.com/watchos/). To run a job in a macOS virtual machine, you must add the `macos` key to the top-level configuration for the job.
231+
232+
Key | Required | Type | Description
233+
----|-----------|------|------------
234+
xcode | Y | String | The version of Xcode that is installed on the virtual machine.
235+
{: class="table table-striped"}
236+
237+
238+
**Example:** Use a macOS virtual machine with Xcode version `9.0`:
239+
240+
```YAML
241+
jobs:
242+
build:
243+
macos:
244+
xcode: "9.0"
245+
```
246+
225247
#### **`branches`**
226248

227249
Defines rules for whitelisting/blacklisting execution of some branches if Workflows are **not** configured. If you are using Workflows, job-level branches will be ignored and must be configured in the Workflows section of your `config.yml` file. See the [workflows](#workflows) section for details. The job-level `branch` key takes a map:

jekyll/_cci2/executor-types.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This document describes images and containers in the following sections:
1414
{:toc}
1515

1616
## Overview
17-
This version of CircleCI enables you to use Docker images or to use a dedicated VM image.
17+
This version of CircleCI enables you to run jobs in one of three environments: using Docker images, using a dedicated Linux VM image, or using a macOS VM image.
1818

19-
There are tradeoffs to `docker` versus `machine`, as follows:
19+
For building on Linux, there are tradeoffs to `docker` versus `machine`, as follows:
2020

2121
Virtual Environment | `docker` | `machine`
2222
----------|----------|----------
@@ -81,6 +81,22 @@ jobs:
8181

8282
The images have common language tools preinstalled. Refer to the [specification script for the VM](https://raw.githubusercontent.com/circleci/image-builder/picard-vm-image/provision.sh) for more information about additional tools.
8383

84+
### Using macOS
85+
86+
Using the `macos` executor allows you to run your build in a VM running macOS with a specific version of Xcode installed.
87+
88+
```
89+
jobs:
90+
build:
91+
macos:
92+
xcode: "9.0"
93+
94+
steps:
95+
# Commands will execute in macOS container
96+
# with Xcode 9.0 installed
97+
- run: xcodebuild -version
98+
```
99+
84100
## Using Multiple Docker Images
85101
It is possible to specify multiple images for your job. Specify multiple images if, for example, you need to use a database for your tests or for some other required service. **In a multi-image configuration job, all steps are executed in the container created by the first image listed**. All containers run in a common network and every exposed port will be available on `localhost` from a [primary container]({{ site.baseurl }}/2.0/glossary/#primary-container).
86102

0 commit comments

Comments
 (0)