I can imagine a couple of solutions, but no one is perfect.
One: you can create a simple application that translates the usual Heroku deployment hook into a format acceptable to Travis. Of course, you need to place it somewhere, but this is a great option for Amazon Lambda or a similar solution. If you ever wanted to try making a server without a server, I think you have the perfect case. And the cost of hosting will be almost nothing.
Two: you can use the release phase on Heroku. Create a script bin/notify-travis , and this is in the file Procfile release: bin/notify-travis . The problem is how to get all the information about the deployed code, like commit sha. To do this, you can enable the lab function called dyno-metadata . It will introduce additional configuration variables, one is HEROKU_SLUG_COMMIT , which contains commit sha. If more data is required, this solution may not work. Make sure bin/notify-travis returns 0. It will be launched just before deployment. And if it fails, your code will not be deployed.
Three: you can find or write your own collector who will send web chat to Travis. The problem is that it will work during the build phase. In case of errors, your code cannot be deployed, but you will send a webhook. And it can also be problematic to get all the necessary information about the assembly, as in solution two.
So you have a few options. I guess the first one is the best, but it may not meet your other requirements.
MichaΕ MΕoΕΊniak
source share