Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Getting started with Jenkins

19 055 vues

Publié le

Getting started with Jenkins

Publié dans : Technologie
  • Soyez le premier à commenter

Getting started with Jenkins

  1. 1. www.edureka.co/jenkins Getting Started with Jenkins
  2. 2. 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
  3. 3. www.edureka.co/jenkins Old Days of Software Development Code 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.
  4. 4. 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.
  5. 5. www.edureka.co/jenkins Benefits of CI  Catch issues fast and nip them in the bud  Everyone can see what’s happening  Automate the build  Keep the build fast  Stop waiting to find out if your code’s going to work  Continuous Integration leads to Continuous Deployment allowing you to deliver software more rapidly Continuous Integration brings following benefits to software development
  6. 6. www.edureka.co/jenkins Jenkins – The ultimate CI Tool Jenkins 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
  7. 7. 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
  8. 8. 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
  9. 9. www.edureka.co/jenkins Jenkins Dashboard Once you run the Jenkins war you can access the Jenkins dashboard from localhost:8080
  10. 10. www.edureka.co/jenkins Jenkins Deployment Another 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
  11. 11. www.edureka.co/jenkins Jenkins Dashboard Once jenkins is deployed successfully, you can access the Jenkins dashboard from localhost:8080/jenkins Jenkins Dashboard
  12. 12. www.edureka.co/jenkins Jenkins – Configuring JDK Once jenkins is running, the first step will be to configure JDK and build tools (Maven/Ant) If you don’t have JDK installed you can select the Install automatically checkbox
  13. 13. 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 haven’t installed Maven/Ant, choose the Install automatically checkbox
  14. 14. www.edureka.co/jenkins Jenkins – Setting up Git Next we will configure Jenkins to work with Git. For that we will add GIT Plugin to Jenkins
  15. 15. www.edureka.co/jenkins Jenkins – Java Project Now 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
  16. 16. www.edureka.co/jenkins Cloning the project Lets clone the project locally so that we can make changes and push our changes to GitHub repository
  17. 17. www.edureka.co/jenkins Jenkins – Creating a new job Lets create our first Job (i.e. the-first-job)
  18. 18. www.edureka.co/jenkins Job – Setting Git repository Next we set the Git repository for the Job
  19. 19. 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
  20. 20. www.edureka.co/jenkins Job – Setting Build Goal Below 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
  21. 21. www.edureka.co/jenkins Jenkins – Running the Job Once the new job is configured you can explicitly run the Job by clicking on Build Now button
  22. 22. www.edureka.co/jenkins Jenkins – Successful Build If build was successful Jenkins will show the blue circle for that build as shown below
  23. 23. www.edureka.co/jenkins Job – Console Output You can see the detailed output of your build from the Console Output menu
  24. 24. www.edureka.co/jenkins Changing Code Lets change the code, below we just done one change. Changed the LIVE_CELL symbol from * to +
  25. 25. www.edureka.co/jenkins Committing the changes Lets commit our change to remote repository
  26. 26. www.edureka.co/jenkins Jenkins – Running the build Once we commit the changes to remote repository, Jenkins will automatically detect the changes and run a new build.
  27. 27. www.edureka.co/jenkins Jenkins – Build Failure As shown in the below snapshot, 6 tests failed after we changed one line of code.
  28. 28. www.edureka.co/jenkins Job – Tracking the changes From the changes option you can easily figure out which code change resulted in build failure. Jenkins shows the failed build with red circle
  29. 29. www.edureka.co/jenkins Job – Successful Build Lets 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
  30. 30. www.edureka.co/jenkins Hands-On
  31. 31. www.edureka.co/jenkins References Continuous 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 Jenkins http://www.nailedtothex.org/roller/kyle/entry/articles-jenkins-email
  32. 32. www.edureka.co/jenkins Survey Your 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.
  33. 33. www.edureka.co/jenkins Course Details Edureka's Continuous Integration with Jenkins course: • Become an expert in Jenkins by mastering Build Pipeline, Reporting, Email & Build plugins • Online Live Classes: 30 hours • Assignments: 25 hours • Project: 20 hours • Lifetime Access + 24 X 7 Support Go to www.edureka.co/jenkins Batch starts from 05 December (Weekend Batch) Understand the Continuous Integration/Delivery concepts and Build Pipelines with Jenkins
  34. 34. www.edureka.co/jenkins Thank You … Questions/Queries/Feedback Recording and presentation will be made available to you within 24 hours

×