When running the staging branch from my pipeline, it's failing and throwing the below error
+ cd /srv/repo
bash: cd: /srv/repo: No such file or directory
Below is my bitbucket-pipelines.yml file
image: "node:6.10.0"
pipelines:
branches:
default:
- step:
script:
- echo 'this is the default script and should do nothing!'
staging:
- step:
script:
- echo 'Building and Deploying the staging branch'
- ssh user@ip
- cd /srv/repo
- git pull
- git checkout staging
- npm install
- pm2 restart staging-api
The `/srv/repo` directory does exist on the `ip` server. Why is the pipeline failing and stating that the directory does not exist?
Hi @Rastalamm,
when you execute `cd user@ip` you are not doing this as part of your SSH session, you are doing this in the build container.
Try something like this: `
sh -c '/bin/sh -c cd /srv/repo && ls -l'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.