Skip to content

Commit ed5efcd

Browse files
committed
expanded CI discussion
1 parent 3d9d673 commit ed5efcd

File tree

1 file changed

+32
-24
lines changed

1 file changed

+32
-24
lines changed

lifecycle.rst

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -388,8 +388,8 @@ referring to in generic terms as subsystems), and we will employ a
388388
simple second-level tool to integrate the output of all those
389389
sophisticated first-level tools. Our choice for the second-level tool
390390
is Jenkins, which provides little more than a means to define a
391-
sequence of scripts to run in response to some event (such as a patch
392-
being checked into the Code Repo).
391+
sequence of scripts (called jobs) to run in response to some event,
392+
such as a patch being checked into the Code Repo.
393393

394394
.. _reading_jenkins:
395395
.. admonition:: Further Reading
@@ -398,7 +398,7 @@ being checked into the Code Repo).
398398

399399
Like many of the tools described in this book, Jenkins has a graphical
400400
dashboard that can be used to create, execute, and view the results of
401-
a set of jobs, but this is mostly useful for toy examples. Because
401+
a set of jobs, but this is mostly useful for simple examples. Because
402402
Jenkins plays a central role in our CI pipeline, it is managed like
403403
all the other components we are building—via a declarative
404404
specification file. This file, called a *Jenkinsfile*, is then checked
@@ -407,25 +407,33 @@ in yet another example of the recursive nature of Lifecycle
407407
Management, manages the Jenkins CI service.
408408

409409
In many ways, Jenkins lets you do anything you want since it is
410-
fundamentally a mechanism that executes shell scripts. When used in a
411-
disciplined way, however, Jenkins provides a means to define a
412-
*Pipeline* consisting of a sequence of *Stages*. Each stage then
413-
executes some script and tests whether the script succeed or
414-
failed. In principle then, Jenkins could be the centerpiece of the
415-
entire CI/CD pipeline since one could define a "Build" stage, followed
416-
by a "Test" stage, and then conditional upon success, conclude with a
417-
"Deploy" stage. In practice, however, Jenkins is used more narrowly to
418-
build-and-test individual components; integrate-and-test various
419-
combinations of components; and under limited circumstances, includes
420-
a "Publish" stage that copies an artifact that's just been built
421-
(e.g., a Docker Image) to the Image Repo.
422-
423-
The main challenge in using Jenkins is establishing a suitable set of
424-
environments for running tests, which we discussed briefly in Section
425-
4.2. Environments can be built from scratch (which takes time but
426-
validates end-to-end integration), or use pre-built containers or VMs
427-
(which is more expedient but risks missing regressions in the
428-
software). No amount of tooling resolves this fundamental trade-off.
410+
fundamentally a mechanism that executes shell scripts. (Jenkins
411+
supports a wide collection of *plugins*, for example interfacing to
412+
GitHub and the various build tools mentioned at the start of this
413+
section, but these essentially provide a convenient way to package
414+
functionality that can be scripted.) When used in a disciplined way,
415+
Jenkins provides a means to define a *Pipeline* consisting of a
416+
sequence of *Stages*. Each stage then executes some script and tests
417+
whether it succeeded or failed. In principle then, Jenkins could be
418+
the centerpiece of the entire CI/CD pipeline since one could define a
419+
"Build" stage, followed by a "Test" stage, and then conditional upon
420+
success, conclude with a "Deploy" stage. In practice, however, Jenkins
421+
is used more narrowly to build-and-test individual components;
422+
integrate-and-test various combinations of components; and under
423+
limited conditions, includes a "Publish" stage that copies the
424+
artifact that has just been built (e.g., a Docker Image) to the Image
425+
Repo.
426+
427+
The important takeaway from this discussion is that there is no
428+
single/global CI job. There are many per-component jobs that
429+
independently publish deployable artifacts when conditions dictate.
430+
Those conditions include: (1) the component passes the required tests,
431+
and (2) the component's version indicates whether or not a new
432+
artifact is warranted. We have already talked about the testing
433+
strategy in Section 4.2 and we describe the versioning strategy in
434+
Section 4.5. These two concerns are at the heart of realizing a sound
435+
approach to Continuous Integration. The tooling—in our case Jenkins—is
436+
just an implementation detail.
429437

430438
4.4 Continuous Deployment
431439
-------------------------
@@ -505,8 +513,8 @@ such that whenever a new Helm chart is checked into a GitRepo, all
505513
Bundles that contain that chart are (re-)deployed on all associated
506514
Cluster Groups.
507515

508-
4.5 Version Control
509-
-------------------
516+
4.5 Versioning Strategy
517+
-----------------------
510518

511519
The CI/CD toolchain introduced in this chapter works only when applied
512520
in concert with an end-to-end versioning strategy, ensuring that the

0 commit comments

Comments
 (0)