github, documentup, and travis-ci

Recently, I heard github, documentup, and travis could cowork together, so the following is how I setup my choqok plurk plugin project on github, documentup and connect to travis and documentup.

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.

https://travis-ci.org/profile/ACCOUNT_NAME/profile

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.

language: c++
notifications:
email:
- YOUR EMAIL
before_install:
- sudo apt-get install PACKAGES REQUIRED BY YOUR PROJECT
script:
- BUILDING STEP 1
- BUILDING STEP 2
- make
branches:
only:
- master

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.

https://travis-ci.org/ACCOUNT_NAME/PROJECT_NAME/builds

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.

http://documentup.com/ACCOUNT_NAME/PROJECT_NAME

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",
"travis": true
}

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

2. http://documentup.com/

3. https://travis-ci.org/

Posted in misc | Tagged , , , , | Leave a comment

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!

I re-installed my server but had forgotten to backup the blog database, so I have a new blog now.

Posted in Uncategorized | 1 Comment