In this video, explore the tool Jenkins in context as well as using plugins to visualize and work with pipelines.
- [Narrator] When developers think of tools for continuous integration Jenkins is likely the first to come to mind. It's easily one of most well known and widely used automation tools available. More then one million users around the world turn to Jenkins for their automation needs, including continuous integration and delivery. Price is one of the reasons that keep application developers and software engineers turning to Jenkins. It's free and open source. Enterprise support for Jenkins is available through CloudBees, the company founded by the original creator of Jenkins. CloudBees is also one of the largest contributors to the Jenkins opensource project. Jenkins is essentially an automation framework that can be extended through plugins. If the base functionality doesn't cover what you need there's probably a plugin that can do the job for you. There are nearly 1,500 plugins available in the plugin index. One plugin we'll be using to enhance our pipeline experience is the Blue Ocean plugin. Blue Ocean is actually a collection of plugins that enhances the Jenkins user interface. Specifically for visualizing pipelines. Jenkins includes a pipeline viewer out of the box but Blue Ocean provides a more modern and up to date interface. We can model our pipeline in the Jenkins web interface or with a Jenkins file stored with our code. The Jenkins file format is based on the Groovy programing language and uses a declarative approach to describe the stages of a pipeline and the actions needed to complete the stage. Let's get started by taking a look at our experimental pipeline as implemented in the Jenkins file. The Jenkins file format is easy to follow. With each configuration element working out into bracketed sections. At the top we have environment details that inject our AWS credentials into the process running our pipeline. So that the credentials are exposed as environment variables. The actual values of the credentials are stored securely in Jenkins so they aren't exposed here. Beneath that, we have our stages. I've modeled our experimental pipeline to follow the seven stages used to get the application code and run some quick tests, build a new version of application and then deploy and test in the staging and production environments. Each of our stages contains the steps that actually run the commands or scripts needed to fulfill the actions for that stage. In the check stage I've used the parallel directive to tell Jenkins to run the lenting and unit test at the same time. Using parallel steps will help speed up the build. Now let's run our pipeline. In the default pipeline view, Jenkins provides a nice visualization of the pipeline. Showing each of the stages we've defined in our Jenkins file. However, we can use the Blue Ocean plugin for what I'll call a more aesthetic pipeline visualization. To get that view, I'll click the open Blue Ocean in this menu on the left. In the Blue Ocean view our pipeline home page shows past runs along with results, commit messages and other details. We also have this handy run button to start the pipeline process. We could also set up a web hook with our get repo so the pipeline runs automatically whenever the code is changed but for this demo I'll just use the run button. We can also see the stages of our pipeline by clicking into the running job. In this view, we can see each stage of our pipeline along with the status. The green and white check marks let us know the stages have passed and the blinking blue icon lets us know which stage is active. The log for each stage is displayed below. And we can expand the form to follow the log in real time. Now let's wait for the build to finish. The green color in the banner at the top lets us know all stages of the pipeline have completed successfully. With a clear pipeline is code format and extensive plugin library and pipeline visualizations with Blue Ocean plugin Jenkins remains a viable tool for continuous integration.
- Key considerations in picking your stack
- The landscape of CI/CD tools
- Self-hosted options such as Jenkins and Bamboo
- SaaS tools such as Travis CI
- Using AWS CodePipeline and CodeBuild
- Tools for code repositories