I currently have a bitbucket repository with a pipeline to Digital Occean. However, Digital Ocean does not pull from the repo successfully.
So far I have:
- A bitbucket pipeline with pointing to the Digital Ocean droplet
- A bitbucket SSH public key which has been added to the Digital Ocean droplet
- A
deploy.sh
file on Digital Ocean which kicks off the deployment process and is referenced by the pipeline on bitbucket - A
pull.sh
file on Digital Ocean which retrieves the latest build from bitbucket and starts the application
What I'm finding is that the pipeline on the bitbucket side fails. And, if I attempt to run pull.sh
manually, I am prompted for the password to the bitbucket repo.
Have I set up SSH incorrectly?
Note that I can find no syntax errors with the pipeline.
On Bitbucket
Bitbucket Pipeline
Variables <user>
and <host>
are correctly configured.
image: atlassian/default-image:latest
pipelines:
default:
- step:
deployment: staging
script:
- cat ./deploy.sh | ssh <user>@<host>
- echo "Deploy step finished"
Bitbucket SSH Key
- Private Key is configured
- Public Key is configured
- Known host has been added and a Host Address (the Digital Ocean Ubuntu droplet IPv4 address) and has a fingerprint
On Digital Ocean
Authorized Key
- Public key provided by Digital Ocean has been added to /root/.ssh/authorized_keys
Deploy.sh
Is located in /
echo "Deploy Script Started"
cd
sh pull.sh
echo "Deploy script finished execution"
Pull.sh
Is located in '/'
cd eg-api
git pull origin master
echo 'Repo: Local Copy Updated'
cd refgator-api
python3 refgator-api.py