01/June/2016


For me Continuous Integration is like someone preparing “Masala Dosa” ( don’t blame me if you feel hungry after seeing these many varieties of yummy dosas 🙂 ) in any of the darshinis in Bangalore.  


The person has all the ingredients needed for Dosa around him , he takes them in required quantity put them together, cooks it and gives it to hungry customer across the counter.  This cycle goes on and on….( youtube )


The story doesn’t end here , customer takes first bite and in case something is wrong; s/he immediately complains to owner of that darshini. Owner in turn informs the dosa maker to do adjustments.


Here customer is Unit Tests / Automated Test which will check the build for each commit to master and if something is broken , informs immediately to commiter


Isn’t it agile software works in similar way ? YUP it does 

Index

1.  What , Why, How “CONTINUOUS INTEGRATION”  ?

2.  Installation of Jenkins

3.  Securing Jenkins

4.  Jenkins  + GitHub Integration

4.1.  Jenkins Job to Connect to GitHub Private Repository

4.2.  How , When To Trigger Jenkins Job

5.  Additional Notes

6.  TBD

7.  Q & A

1. What , Why, How “CONTINUOUS INTEGRATION”  ?

http://www.thoughtworks.com/de/continuous-integration


http://www.martinfowler.com/articles/continuousIntegration.html


https://css-tricks.com/continuous-integration-continuous-deployment/


http://guide.agilealliance.org/guide/ci.html

http://www.seleniumframework.com/continuous-test-automation/what-is-continuous-test-automation-2/   ( Continuous Test Automation )

2. Installation of Jenkins

http://www.vogella.com/tutorials/Jenkins/article.html#installation

3.  Securing Jenkins

http://cvuorinen.net/2013/06/installing-jenkins-ci-server-with-github-integration-for-a-php-project/


http://www.vogella.com/tutorials/Jenkins/article.html#jenkinsconfiguration_user

4. GitHub Integration with Jenkins


When : To trigger Jenkins job in below 2 scenarios

4.1  New code is pushed


4.2  New Pull Request is opened


http://cvuorinen.net/2013/06/installing-jenkins-ci-server-with-github-integration-for-a-php-project/ – Initial setup

Note: This will not work if you have jenkins within company network , as GitHub won’t be able to communicate with system inside company network.

5. Jenkins Job to Connect to GitHub Private Repository

http://blog.loadimpact.com/blog/bootstrap-your-ci-with-jenkins-and-github/


Take care of 2 step authentication , during authenticating private repository

6.  How , When To Trigger Jenkins Job

How can I make Jenkins CI with git trigger on pushes to master?

Polling must die: triggering Jenkins builds from a git hook

7. Send e-mail for each Job 


http://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email

Branch commit should trigger job ( TBT )

Additional Notes:

1. Continuous Testing in Practice ( Blazemeter – http://blazemeter.com/blog )

2. http://aroraglobalservices.blogspot.de/2014/11/continuous-integration-tool-jenkins.html – Continuous Integration Tool : Jenkins + Selenium + TestNG

3. Selenium + Cucumber + Jenkins

TBD


https://jenkins.io/

Jenkins Users ( Google Group )


IRC  ( https://jenkins.io/conduct/ )

1. Public GitHub repo


2.  https://travis-ci.org – Travis CI Integration

Install Jenkins As Service , Create Jenkins User , Check if works with GitHub


http://www.uvd.co.uk/blog/configuring-jenkins-continuous-integration-server-to-work-with-git/

(..The most important thing is not to set a password, otherwise the jenkins user will not be able to connect to the git repo in an automated way…)

http://www.vogella.com/tutorials/Jenkins/article.html#jenkinsconfiguration_ssh

http://shashikantjagtap.net/adventures-with-jenkins-macosx-linux/ ( has copied most of steps from below blog )


https://mattonrails.wordpress.com/2011/06/08/jenkins-homebrew-mac-daemo/


1>  brew install jenkins ( /usr/local/Cellar)


2>  create user for jenkins

     follow steps from 

     https://nickcharlton.net/posts/installing-jenkins-osx-yosemite.html

     http://blog.aditi.com/code/how-to-install-jenkins-on-mac-osx/

      What each of the sub-steps do ??

3>  edit plist

4>  chown -R jenkins..

5>  unload and load -> check if jenkis is up and running


6> Install plugin


7> Create ssh keys for jenkins user

8> Copy pub key in github

9> Create a freestyle job and for credential user jenkins user with SSH username with

     private key . With this make sure connection with GitHub is working perfectly and repo  

     gets cloned under jenkins user directly. 

     NO NEED OF ANY OTHER CHANGES FOR THIS STEP


10> Build / Trigger this job automatically when there is commit to GitHub repo ??

https://help.github.com/articles/generating-an-ssh-key/


>> multiple users public keys in github setting from same machine ?? 

>> http://colonelpanic.net/2011/06/jenkins-on-mac-os-x-git-w-ssh-public-key/ – ?? Answer to above query ?? ( Creating a new hidden user )

>> ?? why to create ssh keys without passphrase 

>> ssh-agent ??

>> why jenkins user from same m/c which has github user already set ??

>> creating jenkins ssh keys with id and pwd is it optional ?? 

>> ?? Why to Create Separate Jenkins User even when existing user can do GitHub operations


Installing Jenkins on OS X Yosemite blog ( Nick Charlton )

“The idea is to try and isolate the permissions the user has. It’s pretty common throughout the Unix world to do this.

You can add ssh keys to this new Jenkins user. It’s probably a good idea to give it separate keys so that it can only access a limited set of other places. GitHub allows this with “deploy keys”, for example.”

https://wiki.jenkins-ci.org/display/JENKINS/Docker+Plugin

http://www.yegor256.com/2014/10/05/ten-hosted-continuous-integration-services.html 

http://www.therightcode.net/use-docker-jenkins-to-run-github-tests/

http://code.tutsplus.com/tutorials/setting-up-continuous-integration-continuous-deployment-with-jenkins–cms-21511

http://stackoverflow.com/questions/11160363/execute-shell-script-after-post-build-in-jenkins

http://stackoverflow.com/questions/9693526/how-can-i-set-the-senders-address-in-jenkins

http://www.focusedsupport.com/blog/beyond-builds-combining-jenkins-and-docker-for-continuously-running-instances/

Jenkins master , Jenkins slave ??

https://wiki.jenkins-ci.org/display/JENKINS/poll-mailbox-trigger-plugin#poll-mailbox-trigger-plugin-Documentation


https://github.com/jenkinsci/poll-mailbox-trigger-plugin/blob/master/README.md#overview

https://www.justinsilver.com/technology/linux/install-jenkins-centos-service/

http://blog.manula.org/2013/03/running-jenkins-under-different-user-in.html

https://www.cloudbees.com/blog/advanced-git-jenkins

Q  and A

common queries/issues and answers 

1. configure gmail smtp globally


 https://support.google.com/mail/answer/1173270?hl=en


http://www.ariefhidayat.com/gmail-setup-for-jenkins-email-notification/

2. configure project to send email after each build


http://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email

3.  What is Jenkins URL


http://stackoverflow.com/questions/11221238/what-does-jenkins-url-means-in-configuration-settings

4.   clone existing jenkins job


http://stackoverflow.com/questions/23838259/how-do-i-clone-a-job-in-jenkins

Advertisements