My deploy script is an extremely simple Git pull. I have a bash script that does git pull that’s part of my source code. The issue is that if the git pull fails for any reason, it’s still showing a successful deploy.
In circle CI, my deploy commands are:
deploy-to-production is a simple script that lets CircleCI ssh and run the pull
ssh firstname.lastname@example.org -i ~/.ssh/mykey.pub -t “cd /home/xxxxx/yyyyy && ./deploy.sh”
The issue is that git pull can fail, but the deploy still shows that it passes. Below is the output (the git conflict caused it to fail) but CircleCI shows green.
Warning: Identity file /home/ubuntu/.ssh/mykey.pub not accessible: No such file or directory.
Warning: Permanently added ‘xxxx.myserver.com,188.8.131.52’ (ECDSA) to the list of known hosts.
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), done.
f23cff8…1793a48 master -> origin/master
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
Running any db migrations.
Yii Migration Tool v1.0 (based on Yii v1.1.8)
No new migration found. Your system is up-to-date.
Connection to xxxxx.server.com closed.