There is a runner that works when pushing, it must execute a script which is located on the server on which the gitlab itself is located.
The script looks like this:
#!/usr/bin/env bash forever stop "myproject" cd /myproject export NODE_PATH=. export NODE_ENV=qa export NODE_INIT_TARGET=build node --use_strict bin/init forever start -a --uid "myproject" --minUptime 20000 --spinSleepTime 20000 bin/start --use_strict those. it just has to run a js script that will first remove the process from forever.js (by stopping the application), assemble the front, then add the process to forever.js (start the application). So if you use your hands in the console to run, everything works. But the runner gives the following error:
Running with gitlab-ci-multi-runner 1.10.4 (b32125f) Using Shell executor... Running on server... Fetching changes... HEAD is now at 5553b27 Merge branch 'dev' into 'master' Checking out ed68665c as dev... Skipping Git submodules setup $ /myproject/myScript.sh /myproject/myScript.sh: строка 3: forever: команда не найдена /myproject/myScript.sh: строка 11: node: команда не найдена /myproject/myScript.sh: строка 13: forever: команда не найдена ERROR: Build failed: exit status 1 What could be the reason?
root@server:/node_data/csgo-forecast/bin# env PATH=/home/sanu/.nvm/versions/node/v6.9.5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin root@server:/node_data/csgo-forecast/bin# sudo -iu gitlab-runner bash -c set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin