Getting Started

The GetMac GitLab Executor is a custom GitLab Runner executor that enables your CI/CD jobs to run on ephemeral GetMac macOS virtual machines. Each job gets a fresh macOS VM that is automatically created before the job and deleted after it completes.

Prerequisites

  • Active GetMac account (free tier available)
  • GetMac API key from the dashboard
  • GitLab Runner installed on your machine

Step 1: Install GitLab Runner

Install GitLab Runner on the machine that will orchestrate your CI/CD jobs. Follow the official GitLab Runner installation guide for your operating system.

Step 2: Register Runner

Register a new runner with your GitLab instance. When prompted for the executor type, select custom.

Step 3: Configure config.toml

Add the following to the [runners.custom] section in your GitLab Runner's config.toml:

[runners.custom]
config_exec = "getmac-gitlab-executor"
config_args = ["config", "--getmac-cloud-api-key", "<API_KEY>"]
prepare_exec = "getmac-gitlab-executor"
prepare_args = ["prepare"]
run_exec = "getmac-gitlab-executor"
run_args = ["run"]
cleanup_exec = "getmac-gitlab-executor"
cleanup_args = ["cleanup"]

Step 4: Set Environment Variables

Configure the following environment variables for the executor:

VariableRequiredDefaultDescription
GETMAC_CLOUD_API_KEYYesYour GetMac API key
GETMAC_CLOUD_PROJECT_IDYesYour GetMac project ID
GETMAC_CLOUD_API_URLYeshttps://api.getmac.io/v1GetMac API endpoint
GETMAC_CLOUD_MACHINE_IMAGENomacos-sequoiaVM operating system image
GETMAC_CLOUD_MACHINE_TYPENomac-m4-c4-m8Hardware specification
GETMAC_CLOUD_REGIONNoeu-central-ltu-1Geographic region
GETMAC_CLOUD_SSH_PRIVATE_KEY_PATHNo$HOME/.ssh/id_rsaPath to SSH private key
GETMAC_CLOUD_DEBUGNoEnable debug logging

See Configuration for full details on all options.

Step 5: Configure .gitlab-ci.yml

Add the following to your .gitlab-ci.yml to run jobs on GetMac runners:

variables:
  GETMAC_CLOUD_PROJECT_ID: "your-project-id"

stages:
  - build

build-job:
  stage: build
  tags:
    - getmac
  script:
    - echo "Building the project..."

Resources

Getting Started | GetMac