Product Engineering

Introducing Jenkins

Jenkins
What is it?

Jenkins, a continuous build tool, enables teams to focus on their work by automating the build, artifact management, and deployment processes.

Continuous Integration is a software development practice where members of a team integrate their work frequently; usually each member integrates at least once daily – leading to multiple integrations per day. Each of the integration is verified by an automated build (including test) to detect integration errors as quickly as possible

Why to use Jenkins?
  • It’s a highly configurable system by itself
  • The additional community developed plug-ins provide more flexibility
  • By combining Jenkins with Ant, Gradle, or other Build Automation tools, the possibilities are limitless
  • Deploys directly to the production or test environments
  • Notifies stakeholders of build status
  • Used by Web QA to run automated tests
  • It does an excellent job of reporting on test results
  • Feature of executing multiple jobs simultaneously at the same time saves test-execution time
  • Nowadays Jenkins have more than 600 plug-ins
  • Supports many programming languages (e.g. Java , python , php , ruby )
  • It’s an open source project and is free of cost
Position of Jenkins in the market

Jenkins’ core functionality and flexibility allows it to fit in a variety of environments and can help streamline the development process for all stakeholders involved, that’s why it’s being used widely in the market now.

  • Conversion rate from Hudson to Jenkins is about 85%
  • Jenkins is most used CI-Server in the industry and it holds 70% of total market share
Jenkins job creation and configuration
  • For automation-testers major work is to develop & execute automation test-suites (which might be sanity packs, regression packs, or functional suites) on multiple environments daily. To achieve this we may use Jenkins job to execute our automation test scripts and might also track the result on a daily basis
Jenkins

Jenkins Job

  • Another Good feature provided by the Jenkins is that you can build your job periodically without any manual intervention and you can also schedule a time to execute your job
Jenkins Feature

Jenkins Feature

  • You will have to set the cron expressions to achieve the above
Enhancing Jenkins

Why Jenkins is so popular and used vastly?

One of the major reasons for this is 100’s of Jenkins ‘plug-ins’ are available to enhance its power, usability and ability. Let’s have a look at some of the best plug-ins to increase the productivity of Jenkins.

  • Parameterized Trigger plug-in–This plug-in allows you to have user inputs as a variable and uses on run time. This is the most used plug-in in automation test jobs widely used in dynamic environments where you have lot of options and user-defined values to be used in the build which may be changing.

Ex:- Let’s suppose we have created a job for sanity test execution on QA environment. Now provided the builds are same, we have a scenario where we have to execute this job on UAT environment, we just need to change the environment variables through these parameterized trigger plug-in and we are good to go.

  • Global Build Stats Plug-in:- First question which arises in capacity planning is “what is your current capacity?” It’s essential to know your current capacity, usage and capability to prepare for capacity planning. You need to know how many builds are happening on a daily and weekly basis. How much time is taken by various builds? What is the waiting period? This plug-in gives you enough data to answer these questions. This plug-in can provide you data as ‘graph’ which can be further consumed.
  • GitHub/GitLab Pull Request Builder-This plug-in provides support to automate code review up to a certain extent in github/gitlab. This plug-in does amazing job once defined for the project. For any new pull request this plug-in does fox merge and runs the build on code, also gathers the necessary static analysis (if configured) or build results and comments back the status to pull request. This helps reviewers get an idea of the health of a code which is going to be merged. You can even define automatic merge if build passes.
  • Multiple SCMs plug-in:–Default SCM section provides only one source control tool/URL option, what if you want to check out from more than 2 repos from multiple source control tools (like svn and git). This plug-in comes in handy for such scenarios. This plug-in facilitates users to add any number of SCM URLs to check out the code.
Putting it all together
  • Accessibility: – Jenkins is a continuous build system; we can install Jenkins on our local system and we can also create our machine as Jenkins local server so that other users can also use Jenkins and execute Jenkins job, there is no need of installing Jenkins on every individual machine, it saves valuable time and resources.
  • Optimum Utilization:-For better utilization of Jenkins we can create Jenkins job for an automation test execution which can execute Jar file periodically and share the results with the shareholders.
  • Security:-And to avoid our Jenkins from unwanted access, we can create multiple users with different roles which can access with local-Jenkins server and perform actions as per their role and accessibility provided by Admin.