Mac OSX gitlab-ci-multi-runner cannot use all local commands
Summary
User commands are not accessible when gitlab.com triggers the build. The build fails because it cannot run a node command. It would be helpful if someone could provide some info on how the runner executes the build as the user. It seems like it loads the same environment as if opening terminal. I understand this will be hard to reproduce, so just any information would be helpful. Looking for the best way to debug this issue.
Actual vs Expected
- Actual, can't run all user commands
- Expected to be able to run all user commands
Issue Examples
- this is when gitlab.com executes the runner
Running with gitlab-ci-multi-runner 1.8.1 (a2efdd4)
Using Shell executor...
Running on Deans-MacBook-Pro-5.local...
Fetching changes...
HEAD is now at a8bbffe remove cruft
Checking out a8bbffe9 as feature/ci...
$ cordova prepare
env: node: No such file or directory
ERROR: Build failed: exit status 1
- Manually ran the runner with
exec
command and that works fine locally.
gitlab-ci-multi-runner exec shell build
Running with gitlab-ci-multi-runner 1.8.1 (a2efdd4)
Using Shell executor...
Running on Deans-MacBook-Pro-5.local...
Cloning repository...
Cloning into '~/projects/hello-mraz/builds/0/project-1'...
done.
Checking out a8bbffe9 as feature/ci...
$ cordova prepare
$ cordova build
Notes
- I think the running user is correct. Its storing the project files in the users home directory, however does not have access to all the available commands.
- I tried manually sourcing ~/.zshrc in the before_script, however with not much luck.
$ source ~/.zshrc
~/.oh-my-zsh/oh-my-zsh.sh: line 12: autoload: command not found
- some commands are available but not all. ie, which rvm works, but which nvm does not.
Environment description
- using gitlab.com
- custom runner installed on local mac osx 10.11.6
- use brew install most of my commands
- nvm to manage node versions
- rvm to manage ruby versions
Used GitLab Runner version
gitlab-ci-multi-runner -v
Version: 1.8.1
Git revision: a2efdd4
Git branch: 1-8-stable
GO version: go1.7.4
Built: Sat, 10 Dec 2016 15:18:00 -0800
OS/Arch: darwin/amd64