First of all, you should have a project hosted by github with well-documented README.md. Then, copy the token from your profile in travis website.
Then choose the project you would like to hook with travis. In the project page of the github
Settings -> Service Hooks -> Travis
Now, you can see a Token field, paste the token you just copied from travis website.
Add a file, .travis.yml, in your project, and its content looks like the below one.
- YOUR EMAIL
- sudo apt-get install PACKAGES REQUIRED BY YOUR PROJECT
- BUILDING STEP 1
- BUILDING STEP 2
This is the travis build script. Remember to install the required packages before building your project. The travis auto build system uses the Ubuntu precise pangolin, so you can try to run the building steps in a virtual machine to see if it works. Once you done, push this file to github, then it will trigger the travis to build your project. You can read the build log from travis’ webpage.
Also, you will receive an email notification if you have set up the notify email section. You may have to change your build script many time to pass the build.
Once you done the auto build part, then the most easy part is to have a webpage to sum them up. You can directly open the documentup webpage to see you project’s webpage.
It’s the default page documentup generate for you, and we would like to add a travis badge on it, so that we can know if the latest code built successfully. So, add one more file, .documentup.json, in your project. It would looks like this.
"name": "TITLE OF THE WEBPAGE",
The only thing you should do is adding the “travis: true” to tell documentup that the project will be auto built by travis, and don’t forget to get the project build status from travis.
You are all set now.
For more information, please visit
1. My project on github, you can get all the necessary example from my project – choqok-plurk