JENKINS : INDUSTRY USE CASES
Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies. In this tutorial, we would explain how you can use Jenkins to build and test your software projects continuously.
You can set up Jenkins to watch for any code changes in places like GitHub, Bitbucket or GitLab and automatically do a build a with tools like Maven and Gradle. You can utilize container technology such as Docker and Kubernetes, initiate tests and then take actions like rolling back or rolling forward in production.
Jenkins is a software that allows continuous integration. Jenkins will be installed on a server where the central build will take place. Jenkins is the leading open-source automation server with some 1,600 plug-ins to support the automation of all kinds of development tasks. Those 1,600 plug-ins span five areas: platforms, UI, administration, source code management, and, most frequently, build management.
Some of the possible steps that can be performed using Jenkins are:
- Software build using build systems such as Gradle, Maven, and more.
- Automation testing using test frameworks such as Nose2, PyTest, Robot, Selenium, and more.
- Execute test scripts (using Windows terminal, Linux shell, etc.
- Achieve test results and perform post actions such as printing test reports, and more.
- Execute test scenarios against different input combinations for obtaining improved test coverage.
- Continuous Integration (CI) where the artifacts are automatically created and tested. This aids in identification of issues in the product at an early stage of development.
How does JENKINS work ?
To operate Jenkins, pipelines are created. A pipeline is a series of steps the Jenkins server will take to perform the required tasks of the CI/CD process. These are stored in a plain text Jenkinsfile.
Following are the steps that are followed to use jenkins :
- Developers do the necessary modifications in the source code and commit the changes to the repository. A new version of that file will be created in the version control system that is used for maintaining the repository of source code.
- The repository is continuously checked by Jenkins CI server for any changes (either in the form of code or libraries) and changes are pulled by the server.
- In the next step, we ensure that the build with the ‘pulled changes’ is going through or not. The Build server performs a build with the code and an executable is generated if the build process is successful. In case of a build failure, an automated email with a link to build logs and other build artifacts is sent to the developer.
- In case of a successful build, the built application (or executable) is deployed to the test server. This step helps in realizing continuous testing where the newly built executable goes through a series of automated tests. Developers are alerted in case the changes have caused any breakage in functionality.
- If there are no build, integration, and testing issues with the checked-in code, the changes and tested application are automatically deployed to the Prod/Production server.
How NETFLIX is using Jenkins ?
There are a number of steps that need to happen before a line of code makes it way into Spinnaker:
- Code is built and tested locally using Nebula
- Changes are committed to a central git repository
- A Jenkins job executes Nebula, which builds, tests, and packages the application for deployment
- Builds are “baked” into Amazon Machine Images
- Spinnaker pipelines are used to deploy and promote the code change
From Netflix perspective they use Jenkins in this way :
Once a line of code has been built and tested locally using Nebula, it becomes ready for continuous integration and deployment. They first push the updated source code to a git repository. Teams are free to find a git workflow that works for them.
Once the change is committed, a Jenkins job is triggered. Their use of Jenkins for continuous integration has evolved over the years. they started with a single massive Jenkins master in our datacenter and have evolved to running 25 Jenkins masters in AWS. Jenkins is used throughout Netflix for a variety of automation tasks above just simple continuous integration.
A Jenkins job is configured to invoke Nebula to build, test and package the application code. If the repository being built is a library, Nebula will publish the .jar to our artifact repository. If the repository is an application, then the Nebula ospackage plugin will be executed. Using the Nebula ospackage (short for “operating system package”) plugin, an application’s build artifact will be bundled into either a Debian or RPM package, whose contents are defined via a simple Gradle-based DSL. Nebula will then publish the Debian file to a package repository where it will be available for the next stage of the process, “baking”.
Source :https://netflixtechblog.com/how-we-build-code-at-netflix-c5d9bd727f15
That’s it.
Thank you.
#TASK 29