TEAM NAME: Azra
- Ajay Chandra Pendyala; [email protected]
- Sunil Narasimhamurthy; [email protected]
- Sohan Kunkerkar; [email protected]
- Pranav Firake; [email protected]
Screencast link
This Tech Talk uses this Node js project for demonstrating the working of Travis CI.
Untested code is broken code - Martin Aspelli
Code without test is broken by design - Jacob Kaplan Moss
So test often, integrate often.
Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each person integrates at least daily - leading to multiple integrations per day. Each integration is verified by an automated build (including test) to detect integration errors as quickly as possible.
In simple words, Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. With just a file called .travis.yml containing some information about our project, we can trigger automated builds with every change to our code base in the master branch, other branches or even a pull request.
- Monitor GitHub projects
- Run Tests
- Provide feedback
- Build artefacts
- Check code quality
- Deploy to cloud services
- Whatever you can make it do
- Sign in to Travis CI with your GitHub account, accepting the GitHub access permissions confirmation
- Once you’re signed in, and Travis CI synchronized your repositories from GitHub, go to your profile page and enable Travis CI for the repository you want to build.
- Add a .travis.yml file to your repository to tell Travis CI what to build:
- Travis CI tests this project against three versions of Ruby and the latest version of Rubinius.
- Add the .travis.yml file to git, commit and push, to trigger a Travis CI build:
- Check the build status page to see if your build passes or fails.
For example the archicture for Travis CI can be given as
These steps were followed in setting up the demo:
-
git clone https://github.com/heroku/node-js-getting-started
-
cd node-js-getting-started
-
vi .travis.yml
-
Add this content there
language: node_js
sudo: false
node_js:
- "stable"
install:
- npm install
deploy:
provider: heroku
api_key: "HEROKU KEY"
app: app-travis
-
Add this to the github project's Readme
[![Build Status](https://travis-ci.org/suniltheta/node-js-getting-started.svg?branch=master)](https://travis-ci.org/suniltheta/node-js-getting-started)
-
Sign into your Travis CI account and sync your repos.
-
Enable Travis CI integration for this project.
-
git add .
-
git commit -m "Commit Message"
-
git push origin master
-
Go to the github repo url and click on the badge that we added for the Travis CI build to see the build results.
-
You can also customize the build like Build branch updates, Limit concurrent jobs, Build pull request updates, Schedule CRON jobs, auto cancelling the jobs, set ENV variables for the jobs etc.
Best resource for setip is https://docs.travis-ci.com/user/customizing-the-build
- Open Source
- Fully hosted
- Distributed
- Incredibly easy
- No worries about back end
- Save git repo maintainer's time
- Easy to configure & use
- High speed
- Great integration with GitHub & cloud services
Travis CI supports large number of tools/ languages which includes almost all popular tools.
e.g.
ANDROID | F# | RUST |
---|---|---|
C | GO | SCALA |
C# | GROOVY | SMALLTALK |
C++ | HASKELL | VISUAL BASIC |
CLOJURE | HAXE | R |
CRYSTAL | JAVA | Ruby |
D | JAVASCRIPT (WITH NODE.JS) | |
DART | JULIA | |
ERLANG | OBJECTIVE-C | |
ELIXIR | PERL | |
F# | PERL6 | |
GO | PHP | |
GROOVY | PYTHON |
- No manual builds
- No build pipelines
- Not suitable for high security projects
- Less extensible than JenKins
Tools for CI are
Jenkins is one of the popular CI tool available.
Comparison
Travis CI | jenkins |
---|---|
fully Hosted with github integration | Hosted internally |
Commercial | Open-Source |
Service | Application |
Convention | Configuration |
Easy to use | Flexible |
If we are coding an open source project on github and want easy to configure CI tool go for Travis CI. The another cool thing is badge we can put on a website or in our readme of github to show whether the build is passing or not. Travis CI for non-open source projects is very expensive starts at $129 per month Jenkins would be better option if you are already familiar with it.
Also, as we worked on the demo for this Tech Talk, we felt that integrating Travis CI as Continuous Integration into our project was much more seamless compared to our prior experiences with one other CI tool Jenkins CI, which was more complex in its functioning and setup. Also, the fact that Travis CI is cloud based increases its accessibility.
Preference for projects :
in-house → Jenkins
Open source and Github.com → Travis-CI