Install GitLab Runner on FreeBSD
Installing GitLab Runner
Here are the steps to install and configure GitLab Runner under FreeBSD:
-
Create the
gitlab-runner
user and group:sudo pw group add -n gitlab-runner sudo pw user add -n gitlab-runner -g gitlab-runner -s /usr/local/bin/bash sudo mkdir /home/gitlab-runner sudo chown gitlab-runner:gitlab-runner /home/gitlab-runner
-
Download the binary for your system:
# For amd64 sudo fetch -o /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-freebsd-amd64 # For i386 sudo fetch -o /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-freebsd-386
You can download a binary for every available version as described in Bleeding Edge - download any other tagged release.
-
Give it permissions to execute:
sudo chmod +x /usr/local/bin/gitlab-runner
-
Create an empty log file with correct permissions:
sudo touch /var/log/gitlab_runner.log && sudo chown gitlab-runner:gitlab-runner /var/log/gitlab_runner.log
-
Create the
rc.d
directory in case it doesn’t exist:mkdir -p /usr/local/etc/rc.d
-
Create the
rc.d
script:sudo bash -c 'cat > /usr/local/etc/rc.d/gitlab_runner' << "EOF" #!/bin/sh # PROVIDE: gitlab_runner # REQUIRE: DAEMON NETWORKING # BEFORE: # KEYWORD: . /etc/rc.subr name="gitlab_runner" rcvar="gitlab_runner_enable" user="gitlab-runner" user_home="/home/gitlab-runner" command="/usr/local/bin/gitlab-runner" command_args="run" pidfile="/var/run/${name}.pid" start_cmd="gitlab_runner_start" gitlab_runner_start() { export USER=${user} export HOME=${user_home} if checkyesno ${rcvar}; then cd ${user_home} /usr/sbin/daemon -u ${user} -p ${pidfile} ${command} ${command_args} > /var/log/gitlab_runner.log 2>&1 fi } load_rc_config $name run_rc_command $1 EOF
-
Make it executable:
sudo chmod +x /usr/local/etc/rc.d/gitlab_runner
- Register the Runner
-
Enable the
gitlab-runner
service and start it:sudo sysrc -f /etc/rc.conf "gitlab_runner_enable=YES" sudo service gitlab_runner start
If you don’t want to enable the
gitlab-runner
service to start after a reboot, use:sudo service gitlab_runner onestart
Upgrading to GitLab Runner 10
To upgrade GitLab Runner from a version prior to 10.0:
-
Stop the Runner:
sudo service gitlab_runner stop
-
Optionally, preserve the previous version of the Runner just in case:
sudo mv /usr/local/bin/gitlab-ci-multi-runner{,.$(/usr/local/bin/gitlab-ci-multi-runner --version| grep Version | cut -d ':' -f 2 | sed 's/ //g')}
-
Download the new Runner and make it executable:
# For amd64 sudo fetch -o /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-freebsd-amd64 # For i386 sudo fetch -o /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-freebsd-386 sudo chmod +x /usr/local/bin/gitlab-runner
-
Edit
/usr/local/etc/rc.d/gitlab_runner
and change:command="/usr/local/bin/gitlab-ci-multi-runner run"
to:
command="/usr/local/bin/gitlab-runner run"
-
Start the Runner:
sudo service gitlab_runner start
-
After you confirm all is working correctly, you can remove the old binary:
sudo rm /usr/local/bin/gitlab-ci-multi-runner.*
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc