A small test of using travis-ci to build a github project and auto deploy it to heroku.
Step 1 - A webapp
Create your webapp. For this I created a simple hello world webapp (1 jsp) with a dummy test (just to give travis-ci something to do).
Commit on github for this step
Step 2 - CI
Let's add that to travis.
Commit on github for this step
Step 3 - Let's get the build status to show at github
Once your build passes - on the travis page you can see an icon - build passing. If you click on that you get a popup of build status links.
Grab the one that uses the same format you want to use for your README.
Create the README file if not already present and include the link to the image. For this test I used markdown README.md
Once pushed - refresh the github project page and you should see the build status icon.
Commit on github for this step
Step 4 - Create heroku app
Heroku's example uses embedded jetty - so update the app
And initial deploy:
$ heroku create web-hello-world
Creating web-hello-world... done, stack is cedar
http://web-hello-world.herokuapp.com/ | [email protected]:web-hello-world.git
Git remote heroku added
$ git push heroku master
And now we can test the deployment
Commit on github for this step
Step 5 - Push builds to heroku
We need to add the heroku information to the travis yaml file. We don't want to have the auth key in plain text - so grab the travis command line tool and then run
$ travis setup heroku
Make sure you choose to encrypt the key.
Commit on github for this step
Step 6 - Test it
Change the app, commit and wait. Your change should arrive on the heroku site.
Once it's been tested and deployed - you can see the change
Commit on github for this step