getting started with jenkins

Download Getting started with Jenkins

If you can't read please download the document

Upload: edureka

Post on 16-Apr-2017

3.310 views

Category:

Technology


0 download

TRANSCRIPT

PowerPoint Presentation

Getting Started with Jenkins

www.edureka.co/jenkins

What will you learn today?

What is Continuous Integration? What is Jenkins and how to install it? Configuring Jenkins Creating a Job with Jenkins Hands On CI with Jenkins

www.edureka.co/jenkins

Old Days of Software DevelopmentCode changes made by individual team members are merged together into working software, which was known as Integration phase.

Integration phase was a hard work which often results in code conflicts, hard to find bugs and even harder to fix them which lead to significant delivery delays

Today businesses need new features to be incorporated into application into days/weeks not months. This requires a change in how softwares are built.

www.edureka.co/jenkins

Continuous Integration (CI)Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day.

Each check-in is then verified by an automated build, allowing teams to detect problems early and deliver the software early.

www.edureka.co/jenkins

Benefits of CICatch issues fast and nip them in the bud

Everyone can see whats happening

Automate the build

Keep the build fast

Stop waiting to find out if your codes going to work

Continuous Integration leads to Continuous Deployment allowing you to deliver software more rapidly

Continuous Integration brings following benefits to software development

www.edureka.co/jenkins

Jenkins The ultimate CI ToolJenkins is a cross platform continuous integration application. Jenkins is used to build and test softwares continuously making it easier for developers to build softwares rapidly

www.edureka.co/jenkins

Who is using Jenkins?

A long list of companies using Jenkins is available here https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=58001258

www.edureka.co/jenkins

Jenkins Installation

To get started with Jenkins , download the jenkins.war from https://jenkins-ci.org/ Once downloaded you can start the jenkins as shown below

www.edureka.co/jenkins

Jenkins Dashboard

Once you run the Jenkins war you can access the Jenkins dashboard from localhost:8080

www.edureka.co/jenkins

Jenkins DeploymentAnother way to get started with Jenkins is to, put the downloaded jenkins.war into webapps directory of your servlet container like Apache Tomcat and then start the Tomcat

When you start the tomcat it will deploy the jenkins war file

www.edureka.co/jenkins

Jenkins DashboardOnce jenkins is deployed successfully, you can access the Jenkins dashboard from localhost:8080/jenkins

Jenkins Dashboard

www.edureka.co/jenkins

Jenkins Configuring JDKOnce jenkins is running, the first step will be to configure JDK and build tools (Maven/Ant)

If you dont have JDK installed you can select the Install automatically checkbox

www.edureka.co/jenkins

Jenkins Configuring Maven/Ant

To configure Maven/Ant just provide the value for MAVEN_HOME or ANT_HOME path variables. If you havent installed Maven/Ant, choose the Install automatically checkbox

www.edureka.co/jenkins

Jenkins Setting up GitNext we will configure Jenkins to work with Git. For that we will add GIT Plugin to Jenkins

www.edureka.co/jenkins

Jenkins Java ProjectNow we are ready to build our projects using Jenkins. To borrow ourself a maven based java project. We are going to fork the https://github.com/wakaleo/game-of-life.git

www.edureka.co/jenkins

Cloning the projectLets clone the project locally so that we can make changes and push our changes to GitHub repository

www.edureka.co/jenkins

Jenkins Creating a new jobLets create our first Job (i.e. the-first-job)

www.edureka.co/jenkins

Job Setting Git repositoryNext we set the Git repository for the Job

www.edureka.co/jenkins

Job Setting Build Triggers Above we have selected the Poll SCM checkbox and set the schedule to * * * * *, which means poll the source code management every day of every month and every minute of every hour

www.edureka.co/jenkins

Job Setting Build GoalBelow we have set the build goal to clean package, which means that build job will fail if the code does not compile or if any of the unit tests fail

www.edureka.co/jenkins

Jenkins Running the JobOnce the new job is configured you can explicitly run the Job by clicking on Build Now button

www.edureka.co/jenkins

Jenkins Successful BuildIf build was successful Jenkins will show the blue circle for that build as shown below

www.edureka.co/jenkins

Job Console OutputYou can see the detailed output of your build from the Console Output menu

www.edureka.co/jenkins

Changing CodeLets change the code, below we just done one change. Changed the LIVE_CELL symbol from * to +

www.edureka.co/jenkins

Committing the changesLets commit our change to remote repository

www.edureka.co/jenkins

Jenkins Running the buildOnce we commit the changes to remote repository, Jenkins will automatically detect the changes and run a new build.

www.edureka.co/jenkins

Jenkins Build FailureAs shown in the below snapshot, 6 tests failed after we changed one line of code.

www.edureka.co/jenkins

Job Tracking the changesFrom the changes option you can easily figure out which code change resulted in build failure. Jenkins shows the failed build with red circle

www.edureka.co/jenkins

Job Successful BuildLets change the code to that of first build by changing the + to * again, commit the changes and push it to GitHub repository. Jenkins will automatically detect the SCM change and start a new build

www.edureka.co/jenkins

Hands-On

www.edureka.co/jenkins

ReferencesContinuous Integration : https://www.thoughtworks.com/continuous-integration

Companies using Jenkins : https://wiki.jenkins-ci.org/pages/viewpage.action?pageId=58001258

Sending Email at every build with Jenkinshttp://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email

www.edureka.co/jenkins

SurveyYour feedback is vital for us, be it a compliment, a suggestion or a complaint. It helps us to make your experience better!

Please spare few minutes to take the survey after the webinar.

www.edureka.co/jenkins

Course DetailsEdureka's Continuous Integration with Jenkins course: Become an expert in Jenkins by mastering Build Pipeline, Reporting, Email & Build pluginsOnline Live Classes: 30 hoursAssignments: 25 hoursProject: 20 hoursLifetime Access + 24 X 7 SupportGo to www.edureka.co/jenkins Batch starts from 05 December (Weekend Batch)Understand the Continuous Integration/Delivery concepts and Build Pipelines with Jenkins

www.edureka.co/jenkins

Thank You

Questions/Queries/Feedback

Recording and presentation will be made available to you within 24 hours

www.edureka.co/jenkins