Composer: save the output to a file

For a while now, at Silicon, we use a combination of Capistrano and Composer to deploy our websites and other services we created.

We tried many possibilities, the one we choose is to run composer install on every deployment. But that means that a dependancy (plugin or theme) can be updated during the deployment.

Of course, it’s not perfect, in an ideal world, we would have a staging server to test and validate the deployment, but it’s not the case. So, to keep a track of Composer’s updates during deployment, I had the idea to mail the output of Composer after the end of the deployment. For doing that, I need to store Composer output in a file and, only if the deployement was successful, send the email with the content of this file. Continue reading Composer: save the output to a file