how to change gitlab-ci runner build path
You can change your runners build path by adjusting the config.toml
. In the [[runners]]
section add or change the builds_dir
directory.
For further reference on runner configuration you can check out the documentation here.
One may prefer to setup build directories globally.
In the file /etc/systemd/system/gitlab-ci-multi-runner.service
there is a line
Environment="DAEMON_ARGS=run --working-directory /var/lib/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner"
So, you may change --working-directory /var/lib/gitlab-runner
to whatever path you want, and wouldn't specify the --builds-dir
on every new registered runner
Environment="DAEMON_ARGS=run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner"
On macOS I was able to find one more way (can be helpful if you have many runners, I guess):
Edit
~/Library/LaunchAgents/gitlab-runner.plist
and modify the path under--working-directory
to whatever you wante.g. from Terminal
vim /Users/Me/Library/LaunchAgents/gitlab-runner.plist
or using your favorite Text EditorRestart it for the changes to take effect
gitlab-runner restart