How to create a macos executor to reuse in multiple jobs?

I’m tying to create an executor for the macos so I can reuse it on the jobs beta, adhoc, but when I do the following

version: 2.1
executors:
  macos_exec:
    macos:
      xcode: "10.2.0"

and try to reuse it, but I get the following error:

...rest_of_code

  build-and-test:
    executor: macos_exec   # [ERROR]: Missing property docker

...rest_code

That looks right, per our docs. Let me check and get back to you.

1 Like

Do you get a green build when you run this config?

version: 2.1

executors:
  macos_exec:
    macos:
      xcode: "10.2.0"

jobs:
  build:
    executor: macos_exec
    steps:
      - run: echo great success
1 Like

@hannah nope, I still get a missing property docker error. Here is the build I’m trying to run:

 iOS Ad Hoc
  adhoc:  # [ERROR]: missing property docker
    executor: macos_exec
    working_directory: ~/app/ios
    environment:
      FL_OUTPUT_DIR: ouput
      FASTLANE: adhoc
      shell: /bin/bash --login -o pipefail
    steps:
      - checkout:
          path: ~/app
      - attach_workspace:
          at: ~/app
      - run:
          name: Run Fastlane adhoc
          command: fatlane adhoc
      - run: *test-results-fastlane
      - store_artifacts:
          path: output/myapp.ipa

Ah, the example I provided needs to be run by itself (with no other config in the .circleci/config.yml file). That way it can establish a baseline of success for macos_exec.

The docker error is likely being introduced in one of the commands. *test-results-fastlane would be my first guess, but fatlane adhoc has a smell for me, too, because everywhere else the word is fastlane.

(General aside, I like to use our CLI tool when I’m setting up a new config, because running circleci-cli config process .circleci/config.yml gives me a fast first-pass check of how my config will compile.)

2 Likes