GitOps-Driven CD Pipeline with Docker Hub and More Jenkinsfile Features
The chapter title is quite a mouthful. Let's unpack it to understand what we'll learn in this chapter.
We will create a postmerge continuous delivery (CD) pipeline that is triggered when a pull request (PR) is merged. The crux of it is the same as the premerge CI pipeline from Chapter 3, GitOps-Driven CI Pipeline with GitHub – listen for an event from GitHub and build accordingly.
Unlike the premerge pipeline, which was entirely self-contained, the postmerge pipeline will interact with external systems to resemble a pipeline for a real product more closely. It will generate a tag based on the list of current tags in the Git repository, build a Docker image as an artifact, log in to Docker Hub (the primary Docker registry at https://hub.docker.com), push the image to Docker Hub, and then push the tag back to GitHub.
In implementing the tasks, we will use additional features of a...