Hi everyone!
A few days ago, my pipeline (which was working right until then) stopped working. My files are the following:
bitbucket-pipelines.yml
image: atlassian/default-image:2
pipelines:
branches:
develop:
- step:
name: Deploy develop to DigitalOcean.
caches:
- node
deployment: test
script:
- cat deploy-develop.sh | ssh (Droplet URI)
devploy-develop.sh
#!/usr/bin/env bash
cd projectFolder
git pull
docker stop projectContainer
docker rm projectContainer
docker tag
docker build --build-arg enviroment=develop -t project .
docker run -d -p 4200:4200 --restart on-failure --name projectContainer project .
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
As I said, it was working perfect for months, but in the last days, every time I run the pipeline, I get the following console output:
<span>Pseudo-terminal will not be allocated because stdin is not a terminal.<br></span><span>Warning: Permanently added the RSA host key for IP address (<strong>'IPADDRESS')</strong> to the list of known hosts.</span><span><br>Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-142-generic x86_64)</span><span> * Documentation: <a href="https://help.ubuntu.com/" target="_blank" rel="noopener nofollow noreferrer">https://help.ubuntu.com</a></span><span> * Management: <a href="https://landscape.canonical.com/" target="_blank" rel="noopener nofollow noreferrer">https://landscape.canonical.com</a></span><span> * Support: <a href="https://ubuntu.com/advantage" target="_blank" rel="noopener nofollow noreferrer">https://ubuntu.com/advantage</a></span><span> Get cloud support with Ubuntu Advantage Cloud Guest:</span><span> <a href="http://www.ubuntu.com/business/services/cloud" target="_blank" rel="noopener nofollow noreferrer">http://www.ubuntu.com/business/services/cloud</a></span><span>121 packages can be updated.</span><span>0 updates are security updates.</span><span>New release '18.04.2 LTS' available.</span><span>Run 'do-release-upgrade' to upgrade to it.<br></span><span>.</span><span>-bash: line 3: cd: projectFolder</span><span>: No such file or directory<br></span><span>git: 'pull</span><span>' is not a git command. See 'git --help'.</span><span>Did you mean this?</span><span> pull<br></span><span>Error response from daemon: No such container: projectContainer<br><br><em>(goes on)</em></span><span>+ cat <a href="https://bitbucket.org/termmed/ng2-snomed-browser/src/05f73894a1604a416fa5d49d60fafa544539120a/deploy-develop.sh" target="_blank" rel="noopener noreferrer">deploy-develop.sh</a> | ssh <strong>(DROPLET URI)</strong><a href="mailto:pgayol@demo.test.termspace.com" target="_blank" rel="noopener nofollow noreferrer"><br></a></span>
Apparently, simple command as "cd" or "git pull" are not working well now.
If I ssh into my droplet and run the script, it works right. The problem appears when the pipelines tries to run it.
Any ideas?
Thank you!