Last active
October 29, 2019 09:41
-
-
Save mrnonz/f8c908fe710ddd4464fa7f4d06e62f12 to your computer and use it in GitHub Desktop.
Startup script for VM to registration Gitlab Runner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 | |
sudo chmod +x /usr/local/bin/gitlab-runner | |
curl -sSL https://get.docker.com/ | sh | |
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash | |
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner | |
sudo gitlab-runner start | |
gitlab-runner register -h | |
sudo gitlab-runner register \ | |
--non-interactive \ | |
--url "https://gitlab.com/" \ | |
--registration-token "CHANGE_GITLAB_RUNNER_TOKEN_HERE" \ | |
--executor "docker" \ | |
--docker-image alpine \ | |
--description "$(hostname)" \ | |
--run-untagged \ | |
--docker-privileged \ | |
--docker-volumes /var/run/docker.sock:/var/run/docker.sock \ | |
--locked="false" | |
sudo sed -i 's/concurrent = 1/concurrent = 2/' /etc/gitlab-runner/config.toml | |
sudo gitlab-runner restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For GCS caching step