Here is How To Add Travis CI To Your GitHub Project – That Build Passing Status Sticker in documentation. Travis is a Continuous Integration Service. Travis CI is non-Free hosted software service. There are lot of Continuous Integration Free Software, which you can install on your server do the same thing. We are writing this guide on How To Add Travis CI To Your GitHub Project, as most uses this service with GitHub. Travis CI tests a build depending on the .travis.yml
file, it will test and send email notification upon failure.
How To Add Travis CI To Your GitHub Project : Known the Basics of Revision Control Softwares
We have talked about the Common Terminologies in Revision Control, basics about Revision Control, SVN or Apache Subversion and obviously about Git. Git is important for PaaS.
How To Add Travis CI To Your GitHub Project
We do not need continuous integration system for all the projects. When there are regular many Pull and Push by many contributors, it is helpful to understand the status. Build Failed not necessary means, the thing will not work. Build Unknown means that .travis.yml
file is not configured. Technically it is better to have a Build Unknown sticker than Build Failed sticker.
---
We are using OS X Homebrew-iTerm2-ZSH setup. We need to install a Ruby Gems first via Terminal (not iTerm2) :
1 | sudo gem install travis-lint |
This will help you to debug the .travis.yml
file via this command :
1 | travis-lint .travis.yml |
Next, register for the service :
https://travis-ci.org/
You will authenticate via GitHub WebHook. It is quite easy to understand web GUI, you are an advanced user, you can read their docs to enable the service by simple clicking. Suppose, you want to create a new project or add the Badge to an existing project. Take this as example :
1 | git clone git@github.com:AbhishekGhosh/joomla.git && cd joomla |
Now, we at least need these files :
.gitignore
README.md
.travis.yml
- Some example script for which the repo is for
You can look at that project’s .gitinore
file :
1 | https://github.com/AbhishekGhosh/joomla/blob/master/.gitignore |
It was generated automatically, while creating the project. This is important. Here is docs on .gitinore
:
1 | http://git-scm.com/docs/gitignore |
Everyone knows, after updating a git locally, you need to push :
1 | git push -u origin master |
In between, you need to add the thing which will give you that Sticker – Build Passing. It is very easy, suppose your GitHub repo’s corresponding Travis CI url is :
1 | https://travis-ci.org/AbhishekGhosh/HP-Cloud-ASCII-Logo |
Extra fun! Point towards – https://gitter.im
, you’ll get a chat service. It is very easy to setup.