2 Pipeline as code with Jenkins

 

This chapter covers

  • How pipeline as code works with Jenkins
  • An overview of Jenkinsfile structure and syntax
  • Introduction to Blue Ocean, the new Jenkins user experience
  • Declarative versus scripted Jenkins pipelines
  • Integration of a GitFlow model within Jenkins projects
  • Tips for productivity and efficiency while writing Jenkinsfiles for complex CI/CD pipelines

There’s no doubt that cloud computing has had a major impact on the way companies build, scale, and maintain technology products. The ability to click a few buttons to provision machines, databases, and other infrastructure has led to an increase in developer productivity we’ve never seen before.

While it was easy to spin up simple cloud architectures, mistakes can easily be made while provisioning complex ones. Human error will always be present, especially when you can launch cloud infrastructure by clicking buttons on the cloud provider’s web console.

The only way to avoid these kinds of errors is through automation, and infrastructure as code (IaC) is helping engineers automatically launch cloud environments quickly and without mistakes. The growth of DevOps and the adoption of its practices have led to more tooling that can implement the IaC paradigm to a larger degree.

2.1 Introducing the Jenkinsfile

2.1.1 Blue Ocean plugin

2.1.2 Scripted pipeline

2.1.3 Declarative pipeline

2.2 Understanding multibranch pipelines

2.3 Exploring the GitFlow branch model

2.4 Test-driven development with Jenkins

2.4.1 The Jenkins Replay button

2.4.2 Command-line pipeline linter

2.4.3 IDE integrations

Summary

sitemap