Pushed in the Real World: Envoyer deployments

This week we feature a simple yet handy real world integration that will be very useful for people using Laravel’s Envoyer service. For those who are unfamiliar with it, Envoyer is a service that allows you to deploy PHP and Laravel applications without any downtime.

We’re quite big fans of Laravel, in fact, Pushed website is built with Laravel, so this is an integration we use ourselves every day.

The goal of this integration is simple: to make Envoyer notify us each time a deployment starts and finishes. To do so we will take advantage of Envoyer’s Deployment Hooks feature, that allow us to trigger action on every stage of the deployment process. We will add push notifications in two actions:

  1. At the beginning of the deployment
  2. Once the deployment has finished

(but feel free to add as many as you like).

To enable push notifications in Pushed for every Envoyer deployment just follow this simple steps:

Open “Deployment Hooks” and click on “+ Add Hook”, a modal window will appear:

image

Then all you have to do is to insert the bash script:

curl -X POST -s \
 –form-string “app_key=” \
 –form-string “app_secret=” \
 –form-string “target_type=” \
 –form-string “target_alias=” \
 –form-string “content={{ project }} deployment started {{ branch }} ({{ author }}).” \
 https://api.pushed.co/1/push

Note we use special Envoyer’s variables.

That’s all! Now we will receive Pushed notifications on each Envoyer deployment.

Support

If you can’t find what you’re looking for in the documentation, please contact us.