Add Jenkins CI assignment documentation

This commit is contained in:
Sergio E
2026-10-07 15:44:43 -04:00
parent 65f08c4525
commit b4d5b79780
9 changed files with 283 additions and 2 deletions
+3 -2
View File
@@ -37,13 +37,13 @@
% Replace these values for each assignment.
\newcommand{\AssignmentTitle}{Group 10 DevOps Project}
\newcommand{\AssignmentNumber}{}
\newcommand{\DocumentVersion}{1.6}
\newcommand{\DocumentVersion}{1.7}
\newcommand{\DocumentStatus}{Active}
\newcommand{\CourseNumber}{SSW 590}
\newcommand{\CourseName}{DevOps}
\newcommand{\Instructor}{Darian Muresan}
\newcommand{\Organization}{Stevens Institute of Technology}
\newcommand{\DocumentDate}{September 29, 2026}
\newcommand{\DocumentDate}{October 7, 2026}
\newcommand{\DueDate}{}
\newcommand{\VERSION}{Version \DocumentVersion}
\newcommand{\GroupNumber}{10}
@@ -115,6 +115,7 @@
\include{devopsLatexDocker}
\include{devopsProjectProposal}
\include{devopsGitea}
\include{devopsJenkins}
\include{devopsActivityBrief}
\include{devopsWorkflow}
\include{devopsEvidence}
+13
View File
@@ -22,6 +22,19 @@ link each entry to the changed chapter, table, figure, or controlled artifact.
\bottomrule
\endlastfoot
October 7, 2026 / 1.7 & SE, CDX &
Added the Chapter 3 Jenkins continuous-integration implementation report:
recorded the Jenkins container deployment, HTTPS proxy hostname, blocked raw
port exposure, installed CI plugins and the plugin dependency failure, added
versioned Jenkins deployment artifacts, and documented the remaining webhook,
status-check, branch-protection, and pull-request evidence gaps honestly
instead of marking unverified work complete. Updated the Caddy configuration,
Hosts and Passwords controls, and troubleshooting notes for Jenkins. &
\ChapterRef{Jenkins}, \hyperref[Table:JenkinsDeployment]{Jenkins deployment},
\hyperref[Table:JenkinsHttps]{Jenkins HTTPS},
\hyperref[Table:JenkinsPluginCheck]{Plugin check},
\hyperref[Table:JenkinsRemainingWork]{Remaining work}\\
September 29, 2026 / 1.6 & SE, TI &
Strengthened the Chapter 2 Gitea startup evidence after rubric review:
added domain expiration and renewal tracking, reproducible Compose and
+2
View File
@@ -11,6 +11,8 @@
\newglossaryentry{evidence}{name={evidence},description={A retained record of an actual execution, observation, or review}}
\newglossaryentry{observability}{name={observability},description={The ability to infer system behavior from signals such as logs, metrics, traces, and health checks}}
\newglossaryentry{pipeline}{name={pipeline},description={An automated sequence that builds, tests, packages, and/or deploys a change}}
\newglossaryentry{webhook}{name={webhook},description={An HTTP callback from one service to another, commonly used to notify a CI system that a repository event occurred}}
\newglossaryentry{mergegate}{name={merge gate},description={A repository rule that prevents a branch or pull request from merging until required checks pass}}
\newglossaryentry{leastprivilege}{name={least privilege},description={A security principle that grants only the access required for the current task or role}}
\newglossaryentry{reverseproxy}{name={reverse proxy},description={A server that receives client requests and forwards them to an internal application service}}
\newglossaryentry{backup}{name={backup},description={A retained copy of data or configuration that can be used to recover after failure or loss}}
+169
View File
@@ -0,0 +1,169 @@
\chapter{Continuous Integration with Jenkins}
\ChapterLabel{Jenkins}
\index{Jenkins}
\index{continuous integration}
\index{merge gate}
\index{webhook}
\section{Jenkins Deployment and Persistence}
This chapter records the Chapter 3 continuous-integration work performed on October 7, 2026. The goal was to add Jenkins to the same startup environment used for the Gitea foundation, connect it to the startup product repository, and use it as the required status check for pull requests. Jenkins was deployed from the official Jenkins LTS container image and placed on the same private Docker network as Gitea and Caddy \cite{JenkinsDocker,JenkinsSecurity,JenkinsReverseProxy,GiteaWebhooks,GiteaProtectedBranches}.
\begin{devopsNote}[Evidence Boundary]
The infrastructure deployment, HTTPS proxy, raw-port blocking, Jenkins startup, plugin installation attempt, and versioned non-secret configuration were completed. The full Gitea webhook, status publication, branch-protection merge gate, and failed-then-repaired pull request were not completed because Jenkins plugin dependencies failed to load and the Jenkins API job-creation attempt was blocked by CSRF/plugin state during follow-up configuration. Those gaps are recorded in Table~\ref{Table:JenkinsRemainingWork} rather than being marked complete.
\end{devopsNote}
\begin{longtable}{L{4.0cm}L{9.2cm}}
\caption{Jenkins Deployment and Persistence Evidence\label{Table:JenkinsDeployment}}\\
\toprule
\textbf{Item} & \textbf{Observed or Configured Value}\\
\midrule
\endfirsthead
\toprule
\textbf{Item} & \textbf{Observed or Configured Value}\\
\midrule
\endhead
\bottomrule
\endlastfoot
Host & Existing DigitalOcean Droplet \texttt{sergio-ssw590-gitea}, public IPv4 \texttt{165.227.90.215}.\\
Capacity before Jenkins & Approximately \texttt{458 MiB} memory, \texttt{8.7 GiB} root filesystem, and no swap.\\
Capacity change & A \texttt{1 GiB} swap file was added at \texttt{/swapfile} to keep Jenkins from exhausting the small Droplet.\\
Jenkins image & \texttt{jenkins/jenkins:2.528.1-lts-jdk21}.\\
Persistent home & Host path \texttt{/opt/jenkins/home} mounted to \texttt{/var/jenkins\_home}.\\
Restart policy & \texttt{unless-stopped} in \texttt{ops/jenkins/compose.yml}.\\
Controller executors & Configured as one controller executor with label \texttt{controller-small-trusted}. This is acceptable only for the small trusted class deployment and should be replaced by a separate agent for untrusted pull requests.\\
Administrator account & Named account \texttt{sespinal-admin}; password stored only on the Droplet under \texttt{/root/jenkins-secrets/admin-password}. The first-boot generated setup password was rotated out of operational use.\\
Restart evidence & Jenkins restarted through Docker Compose and returned \texttt{Jenkins is fully up and running}.\\
\end{longtable}
\section{HTTPS, Access, and Firewall}
Jenkins was not published directly on host port \texttt{8080}. The container exposes \texttt{8080/tcp} only inside Docker networking, and Caddy reverse proxies the public HTTPS hostname to \texttt{jenkins:8080}. Because no \texttt{ci.sespinal590.dev} DNS record existed at the time of implementation, the working Jenkins hostname used for this assignment evidence is \url{https://ci.165.227.90.215.sslip.io/}.
\begin{longtable}{L{4.0cm}L{9.2cm}}
\caption{Jenkins HTTPS and Exposure Checks\label{Table:JenkinsHttps}}\\
\toprule
\textbf{Check} & \textbf{Observed Result}\\
\midrule
\endfirsthead
\toprule
\textbf{Check} & \textbf{Observed Result}\\
\midrule
\endhead
\bottomrule
\endlastfoot
Caddy configuration & Added a second Caddy site block for \texttt{ci.165.227.90.215.sslip.io} with \texttt{reverse\_proxy jenkins:8080}.\\
HTTP behavior & \texttt{http://ci.165.227.90.215.sslip.io/} returned \texttt{308 Permanent Redirect}.\\
HTTPS behavior & \texttt{https://ci.165.227.90.215.sslip.io/} returned \texttt{HTTP/2 403} from Jenkins before login, proving the browser reached Jenkins through Caddy and Jenkins required authentication.\\
Certificate & Caddy obtained a Let's Encrypt certificate for \texttt{ci.165.227.90.215.sslip.io} using the HTTP-01 challenge.\\
Raw Jenkins port & External test to \texttt{ci.165.227.90.215.sslip.io:8080} failed, which is the expected result because port \texttt{8080} is not publicly published.\\
Agent port & Jenkins showed container port \texttt{50000/tcp} internally only; it was not published on the host. No inbound agent port was opened for this assignment.\\
Access control & Jenkins requires login. Additional browser source restriction should be added at Caddy or firewall level before real team use.\\
\end{longtable}
\section{Gitea Trigger and Traceability}
Jenkins and Gitea share the Docker network, so the intended webhook route is private service-to-service traffic from Gitea to Jenkins, while browser traffic reaches Jenkins through Caddy.
\begin{figure}[htbp]
\centering
\fbox{\begin{minipage}{0.88\linewidth}
\centering
\textbf{Team Browser}\\
\texttt{https://ci.165.227.90.215.sslip.io}\\[4pt]
$\Downarrow$\\[4pt]
\textbf{DigitalOcean Cloud Firewall}\\
Public 80/443 only; no public 8080 or 50000\\[4pt]
$\Downarrow$\\[4pt]
\textbf{Caddy Container}\\
TLS termination and reverse proxy\\[4pt]
$\Downarrow$\\[4pt]
\textbf{Jenkins Container}\\
CI controller, trusted small-class executor\\[4pt]
$\Uparrow$\\[4pt]
\textbf{Gitea Container}\\
Future webhook path over the private Docker network
\end{minipage}}
\caption{Jenkins and Gitea integration boundary}
\label{Figure:JenkinsArchitecture}
\end{figure}
The startup repository is \href{https://git.sespinal590.dev/group10-startup/startup-product}{\texttt{group10-startup/startup-product}}. Jenkins was able to reach the repository URL from inside the Jenkins container, and \texttt{git ls-remote} returned commit \texttt{ff266cf} before the Jenkinsfile was added. The Jenkinsfile was then added to the repository as commit \texttt{b0eee02}. A local Gitea filesystem hook issue prevented a normal host-side push, so the operator moved the class repository's branch reference from inside the Gitea container. That action is adequate for a lab setup but is not a substitute for the required pull-request workflow evidence.
\section{Versioned Pipeline and Tests}
The versioned pipeline source is stored in \texttt{ops/jenkins/Jenkinsfile} in this manual repository and was copied into the startup product repository as \texttt{Jenkinsfile}. It contains three stages: checkout, lint, and automated test. The lint step checks for the expected \texttt{README.md} and verifies that it names the startup. The automated test step prints a CI smoke-test marker and lists repository files so the run proves it executed against a real checkout.
\begin{lstlisting}[caption={Jenkinsfile CI stages},label={Listing:JenkinsfileSummary}]
stage('Lint') {
sh 'test -f README.md && grep -qi "startup" README.md'
}
stage('Automated Test') {
sh 'find . -maxdepth 2 -type f | sort | head -20'
}
\end{lstlisting}
\section{Required Merge Gate}
The required merge gate is not yet complete. Gitea branch protection still needs to require the Jenkins status context on pull-request head commits. The exact status context should be the Jenkins job or Gitea Checks context selected after the Jenkins Gitea integration plugin loads successfully. A successful webhook delivery is not enough; the Gitea pull request must show a required check that blocks merge while failing and permits the normal review process after passing.
\section{Failure, Repair, and Review}
The failed-then-repaired pull request sequence remains pending. The required evidence sequence should use one issue-linked pull request and show: failed commit, failed Jenkins run, blocked merge, repair commit, passing run, peer review, and merge. This manual currently does not claim that evidence because no Jenkins status check was successfully published back to Gitea.
\section{Credentials and Build Boundary}
\begin{longtable}{L{4.0cm}L{9.2cm}}
\caption{Jenkins Credentials and Build Boundary\label{Table:JenkinsCredentials}}\\
\toprule
\textbf{Control} & \textbf{Implementation or Required Follow-up}\\
\midrule
\endfirsthead
\toprule
\textbf{Control} & \textbf{Implementation or Required Follow-up}\\
\midrule
\endhead
\bottomrule
\endlastfoot
Jenkins administrator credential & Stored only on the Droplet in \texttt{/root/jenkins-secrets/admin-password}; not committed to Git or printed in this manual.\\
Initial setup password & Jenkins printed a generated first-boot password in container logs. It was replaced operationally by the named admin account and should be rotated again before long-term use.\\
Gitea integration token & Pending. A narrow token should be created for repository read and status/check reporting only.\\
Build location & Builds currently run on the controller because this is a small trusted course deployment. This is a risk: untrusted Jenkinsfile authors could execute commands on the controller.\\
Compensating restriction & Only trusted team members should be able to edit the Jenkinsfile until a separate build agent is deployed and secrets are isolated from untrusted pull requests.\\
\end{longtable}
\begin{longtable}{L{4.0cm}L{9.2cm}}
\caption{Jenkins Plugin Check and Operator Response\label{Table:JenkinsPluginCheck}}\\
\toprule
\textbf{Plugin or Check} & \textbf{Result}\\
\midrule
\endfirsthead
\toprule
\textbf{Plugin or Check} & \textbf{Result}\\
\midrule
\endhead
\bottomrule
\endlastfoot
Installed plugin attempt & \texttt{git}, \texttt{workflow-aggregator}, \texttt{pipeline-stage-view}, \texttt{gitea}, and \texttt{gitea-checks}.\\
Recorded plugin versions & Git \texttt{5.10.1}, Pipeline \texttt{608.v67378e9d3db\_1}, Pipeline Stage View \texttt{2.41}, Gitea \texttt{273.vb\_78d13f6d9a\_d}, and Gitea Checks \texttt{604.638.ve9e5472551b\_3}.\\
Plugin warning & Jenkins reported security advisories for some Pipeline-related plugins during installation.\\
Plugin failure & Jenkins logs reported dependency failures requiring newer \texttt{bouncycastle-api}, \texttt{caffeine-api}, and \texttt{gson-api} plugins. A repair attempt was made, but the failures persisted in the last observed logs.\\
Operator response & The issue was recorded as a blocker. The correct next action is to update the Jenkins base image or reset the plugin catalog/home state, then reinstall plugins and re-run the Gitea check integration.\\
\end{longtable}
\section{Manual Quality and Controls}
\begin{longtable}{L{4.4cm}L{2.0cm}L{6.8cm}}
\caption{Chapter 3 Rubric Evidence Status\label{Table:JenkinsRemainingWork}}\\
\toprule
\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence or Gap}\\
\midrule
\endfirsthead
\toprule
\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence or Gap}\\
\midrule
\endhead
\bottomrule
\endlastfoot
Jenkins deployment and persistence & Partial & Jenkins container, persistent home, restart policy, swap, named admin account, and restart evidence are documented. A longer restart persistence screenshot/check should be captured after browser login.\\
HTTPS, access control, and firewall & Partial & HTTPS, redirect, certificate acquisition, login requirement, and blocked raw port \texttt{8080} are documented. Browser source restriction still needs tightening.\\
Gitea trigger and traceable Jenkins run & Pending & Jenkins can reach the repository, but webhook delivery and matching Jenkins run are not proven.\\
Versioned pipeline with meaningful build and tests & Partial & Jenkinsfile is versioned and committed as \texttt{b0eee02}; Jenkins plugin/API issues blocked the final run evidence.\\
Required Gitea status check and merge gate & Pending & Branch protection and required Jenkins context still need configuration after plugin repair.\\
Failed-then-repaired, reviewed pull request & Pending & No failed/repaired PR sequence has been completed.\\
Credentials, pipeline trust boundary, and plugin operations & Partial & Credentials are not committed; controller-build risk and plugin failures are documented.\\
Versioned IT manual, history, Hosts/Passwords hints, and evidence & Complete for current state & Version 1.7, this history entry, Jenkins host/password controls, deployment artifacts, citations, glossary/index terms, and honest blockers are included.\\
\end{longtable}
+40
View File
@@ -44,3 +44,43 @@
year = {2026},
note = {Accessed September 29, 2026}
}
@misc{JenkinsDocker,
author = {{Jenkins Project}},
title = {Installing Jenkins with Docker},
howpublished = {\url{https://www.jenkins.io/doc/book/installing/docker/}},
year = {2026},
note = {Accessed October 7, 2026}
}
@misc{JenkinsSecurity,
author = {{Jenkins Project}},
title = {Securing Jenkins},
howpublished = {\url{https://www.jenkins.io/doc/book/security/}},
year = {2026},
note = {Accessed October 7, 2026}
}
@misc{JenkinsReverseProxy,
author = {{Jenkins Project}},
title = {Reverse proxy configuration with Jenkins},
howpublished = {\url{https://www.jenkins.io/doc/book/system-administration/reverse-proxy-configuration-with-jenkins/}},
year = {2026},
note = {Accessed October 7, 2026}
}
@misc{GiteaWebhooks,
author = {{Gitea}},
title = {Webhooks},
howpublished = {\url{https://docs.gitea.com/usage/repository/webhooks/}},
year = {2026},
note = {Accessed October 7, 2026}
}
@misc{GiteaProtectedBranches,
author = {{Gitea}},
title = {Protected branches},
howpublished = {\url{https://docs.gitea.com/usage/access-control/protected-branches/}},
year = {2026},
note = {Accessed October 7, 2026}
}
+5
View File
@@ -2,3 +2,8 @@ git.sespinal590.dev {
encode zstd gzip
reverse_proxy gitea:3000
}
ci.165.227.90.215.sslip.io {
encode zstd gzip
reverse_proxy jenkins:8080
}
+4
View File
@@ -0,0 +1,4 @@
ci.165.227.90.215.sslip.io {
encode zstd gzip
reverse_proxy jenkins:8080
}
+31
View File
@@ -0,0 +1,31 @@
pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Lint') {
steps {
sh '''
set -eu
test -f README.md
grep -qi "startup" README.md
'''
}
}
stage('Automated Test') {
steps {
sh '''
set -eu
printf "CI smoke test for startup-product\\n"
find . -maxdepth 2 -type f | sort | head -20
'''
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
services:
jenkins:
image: jenkins/jenkins:2.528.1-lts-jdk21
container_name: jenkins
restart: unless-stopped
environment:
- JENKINS_OPTS=--prefix=/
- JAVA_OPTS=-Xms128m -Xmx384m -Djenkins.install.runSetupWizard=true
volumes:
- /opt/jenkins/home:/var/jenkins_home
networks:
- gitea_default
networks:
gitea_default:
external: true