summaryrefslogtreecommitdiff
path: root/lib/gitlab/ci/runner_instructions/templates/linux/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/ci/runner_instructions/templates/linux/install.sh')
-rw-r--r--lib/gitlab/ci/runner_instructions/templates/linux/install.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/ci/runner_instructions/templates/linux/install.sh b/lib/gitlab/ci/runner_instructions/templates/linux/install.sh
new file mode 100644
index 00000000000..6c8a0796d23
--- /dev/null
+++ b/lib/gitlab/ci/runner_instructions/templates/linux/install.sh
@@ -0,0 +1,12 @@
+# Download the binary for your system
+sudo curl -L --output /usr/local/bin/gitlab-runner ${GITLAB_CI_RUNNER_DOWNLOAD_LOCATION}
+
+# 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