We already understood the idea behind acceptance testing and know how to configure Docker registry, so we are ready for its first implementation inside the Jenkins pipeline.
Let's look at the figure that 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.
- Staging the Docker host 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 separate staging server). In order...