In the post below I outline how you can use Travis-CI to trigger deployment in Envoyer on a build that passes.
Since it first launched, I've been a massive fan of Envoyer.io. You can't put a price on peace of mind and with zero downtime, health checks and heartbeats, it serves my needs perfectly. It's also a wonderful showcase for what Laravel 5 can do.
For myself, the one piece of the production deployment puzzle that I hadn't addressed was the link between continuous integration (CI) and zero downtime. Envoyer is smart enough to ensure that when I push to Github, deployment will take place automatically. It's also incredibly smart to only symlink to the new release directory when the deploy has happened successfully. However it cannot of course, prevent deployment if I screw up my code or a rogue Composer package introduces some anomalies and throws errors into the production environment...and why should it. It's not the purpose for which it was designed for.
Now I acknowledge that we're lucky in the world of Laravel. We have Homestead and Laravel Forge. You could quite easily do without CI and still sleep tight at night after pushing to Github. However, there have been two occasions (during the L4 to L5 upgrade process) whereby my site worked just fine on Homestead but didn't work as planned when I pushed up to Forge. Since then, I've become a big fan of Travis-CI. So this morning I set out to see how easily I could make Travis talk to Envoyer.
Within Envoyer, Taylor has given us a nice deployment URL which we can use to trigger our deploys (you can just type it into your URL bar to start deployment if you like). Knowing how Travis allows for webhooks, I set about solving my little problem - and it turns out it's super easy so I thought I'd share it with the community.
and type your Github login in. Then you can run the following command, pasting in your deployment URL within the quotation marks:
travis encrypt "https://envoyer.io/deploy/WHATEVER_MY_KEY_IS" --add notifications.webhooks.urls
on_success: always on_failure: never
notifications: webhooks: urls: secure: YOURENCRYPTEDENVOYERDEPLOYMENTURL on_success: always on_failure: never
So wonderfully trouble free and all without the need for a complicated Travis-CI service provider. Credit to Taylor for making Envoyer so easy to use and so damn robust.