We already understand the idea behind acceptance testing and know how to configure the Docker registry, so we are ready for its first implementation inside the Jenkins pipeline.
Let's look at the following diagram, which presents the process we will use:
The process goes as follows:
- The developer pushes a code change to GitHub
- Jenkins detects the change, triggers the build, and checks out the current code
- Jenkins executes the commit phase and builds the Docker image
- Jenkins pushes the image to Docker registry
- Jenkins runs the Docker container in the staging environment
- The Docker host on the staging environment needs to pull the image from the Docker registry
- Jenkins runs the acceptance test suite against the application running in the staging environment
For the sake of simplicity, we will run the Docker container locally (and not on a...