@@ -387,8 +387,45 @@ different build tools for their individual projects (which we've been
387387referring to in generic terms as subsystems), and we will employ a
388388simple second-level tool to integrate the output of all those
389389sophisticated first-level tools. Our choice for the second-level tool
390- is Jenkins, which provides little more than a means to define a script
391- (called a job) to run in response to some event.
390+ 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).
393+
394+ .. _reading_jenkins :
395+ .. admonition :: Further Reading
396+
397+ `Jenkins <https://www.jenkins.io/doc/ >`__.
398+
399+ Like many of the tools described in this book, Jenkins has a graphical
400+ 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
402+ Jenkins plays a central role in our CI pipeline, it is managed like
403+ all the other components we are building—via a declarative
404+ specification file. This file, called a *Jenkinsfile *, is then checked
405+ into the repo just like all the other configuration-as-code files, and
406+ in yet another example of the recursive nature of Lifecycle
407+ Management, manages the Jenkins CI service.
408+
409+ 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.
392429
3934304.4 Continuous Deployment
394431-------------------------
0 commit comments