I'm trying to automate deployment of a node-app. I'm using forever to run the app. But before deploying the next version I need to quit the current process. I'm using forever stop /path/ but sometimes the process is not running. That will return a error and quit the Wercker-process. Is there a way to ignore the error of a specific Wercker-command?
- script:
name: stop application
code: |
ssh -i $PRIVATEKEY_PATH -l username -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 199.199.46.17 forever stop ikbendirk-server.js
So the fix was relative easy: by adding a or statement you can get Wercker to ignore the error and go to the next step.
- script: name: stop application code: | ssh -i $PRIVATEKEY_PATH -l username -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 199.199.46.17 forever stop /var/www/ikbendirk/api/ikbendirk-server.js || echo "next!"