Figure 15-3 Complete CI/CD Pipeline
In the building phase, the code is compiled for languages
such as Java, C/C++, or Go; for code written in
interpreted languages such as Ruby or Python, the
compilation step can be ignored. Regardless of the
language the code is written in, in most cases, the output
of the building phase is a Docker image that contains all
the code, all required dependencies, and startup scripts
to ensure that the application runs consistently,
whatever the destination environment might be.
During the testing phase, automated tests are run to
ensure correct behavior of the product. In an effort to
catch software bugs as soon as possible, tests are
developed at this stage to make sure the new code
follows the expected requirements. Several types of tests
are run at this stage, from unit and smoke tests that
perform quick sanity checks, to integration, code
coverage, code standards, and end-to-end tests that try
to mimic the way users interact with the software as
closely as possible. Developers follow the results of the
tests, and if any of the tests fail, the developers can
immediately address the problems and fix the code and
restart the pipeline until all tests pass.
The next phase in the CI/CD pipeline is the deployment
phase. By this stage, the software has been packaged and
tested and is ready to be deployed for consumption.
Before containers, in most cases, this meant installing
the new binaries in new servers, either physical or
virtual, and reconfiguring the load balancers to point to
the new servers and monitor the environment to ensure
that the new version worked as expected. With the
advent of Docker and similar container technologies, the