'I want to run gitlab-runner like executing commands hook only

I have a dedicated server and attached Git-Runner. We just want to run something like this on a file path

git pull
npm install
npm run prod

the problem is git-runner is not picking up already installed packages like npm. I also completed setting up the git-runner user to ubuntu (sudo-user) and also i get echo of user name in CI-CD pipeline.

At last this CI-CD pipeline is going to execute shell script file every time we push and update the server nothing else.

our main motive is to update the server by firing commands



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source