I have a GitLab Runner setup on a Linux VM. I installed this manually using:
curl -LJO "https://gitlab-runner-downloads.s3.amazonaws.com/latest/deb/gitlab-runner_amd64.deb"
sudo dpkg -i gitlab-runner_amd64.deb
sudo gitlab-runner register
I have also installed the package containing the command with:
sudo dotnet tool install --global dotnet-deb
My gitlab build scipt command is:
'dotnet-deb MyProject.csproj -r:linux-x64 -f:net6.0 -c:Release'
If I open a terminal and execute the command, it executes and completes, however when the runner executes this command it errors with:
bash: line 112: dotnet-deb: command not found
One solution I've seen posted is details here:
you can modify the file '/etc/sudoers', find "Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin ", change it as "Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin"
When I checked this file on my system sudo nano /etc/sudoers was complete empty.
If I execute echo $PATH one of the entries is:
/home/jammer/.dotnet/tools
Checking this directory shows the package dotnet-deb, so it's definitely installed.
I tried to use the System Monitor to figure out what account the runner was running under but it wasn't listed.
I'm assuming at this point that it's possibly something to do with the different PATH variables but I'm completely in the dark as to what config changes to make.
Any pointers would be appreciated.