After deploying code to my server using bit bucket scp pipe, I am using another pipeline to run a script to install node modules and start node server but the pipeline results as failed status and shows like
./server-run.sh: line 1: npm: command not found ./server-run.sh: line 2: pm2: command not found
image: node:10.15.3
pipelines:
custom:
test:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- pipe: atlassian/scp-deploy:0.3.3
variables:
USER: $USER
SERVER: $SERVER
REMOTE_PATH: '/var/www/stockTest/server'
LOCAL_PATH: 'server/*'
server-start:
- step:
caches:
- node
script:
- ssh $USER@$SERVER "cd /var/www/stockTest/server && ./server-run.sh"
server-run.sh
npm i
pm2 start server-start.js --name stockTest