Vérifie dans le terminal :
xcode-select --install # pour avoir les outils de compilation de base brew --version # Homebrew installé ?
Si Homebrew n’est pas présent :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install gitlab-runner
Cela installe le service gitlab-runner et crée le binaire /usr/local/bin/gitlab-runner.
il faut vérifier quand même :
gitlab-runner --version
Dans GitLab :
Settings –> CI/CD –> Runners –> New project runner
Puis, dans le terminal macOS :
sudo gitlab-runner register
Il faut juste répondre :
Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com/): https://gitlab.com/ Please enter the gitlab-ci token for this runner: (glrt-xxxxx...) Please enter the gitlab-ci description for this runner: Mac Runner Étudiante Please enter the gitlab-ci tags for this runner (comma separated): mac,shell Please enter the executor: docker, shell, ssh, etc: shell
Normalement le Runner sera enregistré dans ~/.gitlab-runner/config.toml.
~/.gitlab-runner/config.toml
Liste des runners enregistrés :
gitlab-runner list
On devrait voir quelque chose comme :
Listing configured runners ConfigFile=/Users/etudiante/.gitlab-runner/config.toml Mac Runner Étudiante Executor=shell
brew services start gitlab-runner
ou
gitlab-runner run
test-local: tags: [mac, shell] script: - echo "Exécution sur un Mac local" - sw_vers - java -version
Lancer le pipeline : pour voir le job s’exécuter sur le Mac !
permission denied