Mac installation gitlab-ci-multi-runner running sonar


Installing maven

tar xzvf apache-maven-3.3.9-bin.tar.gz
export PATH=apache-maven-3.3.9/bin:$PATH
export PATH=/usr/local/bin/apache-maven-3.3.9/bin:$PATH

Install gitlab-ci-multi-runner

If gitlab is version 8, it is sad.

Because of this Runner >= 9.0 requires GitLab CE/EE >= 9.0 and will not work
with older GitLab versions.

Because in the official document,Install on macOS

sudo curl --output /usr/local/bin/gitlab-runner

This installed version is not compatible with gitlab8, and tears are flowing.

Solution, Install Specified Version
https://gitlab-ci-multi-runne …
Download binaries/gitlab-ci-multi-runner-Darwin-amd64 from here

cp gitlab-ci-multi-runner-darwin-amd64 /usr/local/bin/gitlab-ci-multi-runner
chmod +x /usr/local/bin/gitlab-ci-multi-runner


➜  ~ gitlab-ci-multi-runner register
WARNING: Running in user-mode.
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...

Please enter the gitlab-ci coordinator URL (e.g.
Please enter the gitlab-ci token for this runner:
Please enter the gitlab-ci description for this runner:
[xxxx-Pro.local]: sonar-maven-java8
Please enter the gitlab-ci tags for this runner (comma separated):
Whether to run untagged builds [true/false]:
[false]: true
Registering runner... succeeded                     runner=zm4f-eFf
Please enter the executor: docker-ssh, virtualbox, docker+machine, docker-ssh+machine, docker, parallels, shell, ssh, kubernetes:
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded!


gitlab-ci-multi-runner install
gitlab-ci-multi-runner start
gitlab-ci-multi-runner run

Configure gitlab runner environment variables

vim ~/.gitlab-runner/config.toml

Complete as follows

concurrent = 1
check_interval = 0

  name = "sonar-maven-java8"
  url = ""
  token = "xxxxxx"
  environment = ["MAVEN_HOME=/Users/xxxx/xxxx/build/apache-maven-3.3.9"]
  executor = "shell"

Configure settings for maven

vim ~/.m2/settings.xml

Complete as follows

            <name>Nexus aliyun</name>
                <!-- Optional URL to server. Default value is http://localhost:9000 -->

After that, it was basically completed.