-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from QuickCorp/v2.3
gitlab-runner-installer.sh
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
REGISTRATION_TOKEN=$1 | ||
|
||
# Download the binary for your system | ||
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64 | ||
|
||
# Give it permissions to execute | ||
sudo chmod +x /usr/local/bin/gitlab-runner | ||
|
||
# Create a GitLab CI user | ||
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash | ||
|
||
# Install and run as service | ||
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner | ||
sudo gitlab-runner start | ||
|
||
sudo apt install -y docker.io | ||
|
||
sudo gitlab-runner register -n \ | ||
--url https://gitlab.com/ \ | ||
--registration-token $REGISTRATION_TOKEN \ | ||
--executor shell \ | ||
--description "QCObjects Runner" | ||
|
||
sudo usermod -a -G sudo gitlab-runner | ||
sudo usermod -aG docker gitlab-runner | ||
sudo gitlab-runner restart |