docs: add Jenkins CI chapter and update DevOps manual to v1.4
@@ -21,7 +21,7 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
SHORT_SHA="$(printf '%s' "$GITHUB_SHA" | cut -c1-7)"
|
||||
BUILD_ID="v1.3+build.${GITHUB_RUN_NUMBER}.${SHORT_SHA}"
|
||||
BUILD_ID="v1.4+build.${GITHUB_RUN_NUMBER}.${SHORT_SHA}"
|
||||
|
||||
cat > manual/build_metadata.tex <<EOF
|
||||
\renewcommand{\BuildIdentifier}{${BUILD_ID}}
|
||||
|
||||
@@ -0,0 +1,824 @@
|
||||
\chapter{Continuous Integration with Jenkins}
|
||||
\label{chap:jenkins-ci}
|
||||
|
||||
\section{Overview}
|
||||
This chapter documents the Jenkins continuous integration system deployed
|
||||
for the SSW590 startup product. Jenkins integrates with Gitea to
|
||||
automatically validate source code changes.
|
||||
|
||||
\section{Jenkins Deployment and Persistence}
|
||||
|
||||
Jenkins was deployed as a Docker container on the team's
|
||||
DigitalOcean Droplet running Ubuntu 24.04. The deployment uses
|
||||
the custom image \texttt{jenkins-node:2.580.1}, which provides
|
||||
the Jenkins automation server and the Node.js tooling required
|
||||
for the startup product's continuous integration pipeline.
|
||||
|
||||
The Docker Compose project is located at
|
||||
\texttt{/opt/jenkins}. The Jenkins container uses the
|
||||
\texttt{jenkins\_jenkins\_internal} bridge network.
|
||||
|
||||
\subsection{Persistent Storage}
|
||||
|
||||
Jenkins configuration, installed plugins, job definitions,
|
||||
credentials, and build history are stored in the persistent
|
||||
host directory \texttt{/opt/jenkins/jenkins\_home}, mounted
|
||||
inside the container at \texttt{/var/jenkins\_home}.
|
||||
|
||||
This bind mount separates Jenkins application data from the
|
||||
container's writable layer so that the data remains available
|
||||
when the container is replaced, provided the host directory
|
||||
is preserved.
|
||||
|
||||
\subsection{Resource Limits}
|
||||
|
||||
The Droplet has limited system resources. Docker Compose
|
||||
therefore restricts Jenkins to 384 MiB of container memory
|
||||
and 768 MiB of combined memory and swap.
|
||||
|
||||
The Java virtual machine is configured with an initial heap
|
||||
of 64 MiB, a maximum heap of 192 MiB, a maximum metaspace
|
||||
of 128 MiB, and the serial garbage collector.
|
||||
|
||||
These limits reduce resource consumption but do not
|
||||
guarantee that every build will succeed under memory pressure.
|
||||
|
||||
\subsection{Network Exposure and Restart Policy}
|
||||
|
||||
The Jenkins HTTP service listens on container port 8080,
|
||||
published only to \texttt{127.0.0.1:8080} on the Droplet.
|
||||
This prevents direct access to Jenkins through the Droplet's
|
||||
public IP address on port 8080.
|
||||
|
||||
The container uses the restart policy \texttt{no}.
|
||||
Consequently, an administrator must explicitly start Jenkins
|
||||
after a container stop or host restart.
|
||||
|
||||
\subsection{Deployment Verification}
|
||||
|
||||
The deployment was verified using the following commands
|
||||
on the DigitalOcean Droplet:
|
||||
|
||||
\begin{verbatim}
|
||||
cd /opt/jenkins
|
||||
docker compose config
|
||||
docker ps --filter name=jenkins
|
||||
\end{verbatim}
|
||||
|
||||
The Docker inspection confirmed that the container was
|
||||
running with image \texttt{jenkins-node:2.580.1},
|
||||
persistent storage, the private bridge network, and
|
||||
localhost-only HTTP port publishing.
|
||||
|
||||
\section{HTTPS and Reverse Proxy Configuration}
|
||||
|
||||
The Jenkins continuous integration service is published through
|
||||
the hostname \url{https://ci.nageshwaran.dev}. The deployment
|
||||
uses Caddy as its reverse proxy, alongside the existing Gitea
|
||||
service at \url{https://git.nageshwaran.dev}.
|
||||
|
||||
\subsection{Caddy Reverse Proxy Rules}
|
||||
|
||||
The reverse proxy configuration is stored in
|
||||
\texttt{/opt/gitea/Caddyfile} on the DigitalOcean Droplet.
|
||||
|
||||
The verified configuration contains the following routes:
|
||||
|
||||
\begin{verbatim}
|
||||
git.nageshwaran.dev {
|
||||
reverse_proxy gitea:3000
|
||||
}
|
||||
|
||||
ci.nageshwaran.dev {
|
||||
reverse_proxy jenkins:8080
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
Caddy routes requests according to their requested hostname.
|
||||
Traffic for the Gitea hostname is forwarded to container port
|
||||
3000, while requests for the Jenkins hostname are forwarded
|
||||
to container port 8080.
|
||||
|
||||
\subsection{Network Isolation}
|
||||
|
||||
The Jenkins Docker Compose configuration publishes port 8080
|
||||
only on the Droplet loopback interface, using
|
||||
\texttt{127.0.0.1:8080:8080}.
|
||||
|
||||
Caddy forwards traffic to the Jenkins service by its Docker
|
||||
service name, \texttt{jenkins}, on port 8080. This separates
|
||||
the public HTTPS entry point from the Jenkins application
|
||||
listener.
|
||||
|
||||
The internal Jenkins port does not need to be published
|
||||
directly on the Droplet's public network interface.
|
||||
|
||||
\subsection{HTTPS Operations}
|
||||
|
||||
The Caddy configuration uses hostname-based site blocks,
|
||||
allowing Caddy to manage HTTPS for the configured domains
|
||||
when DNS, certificate issuance, and network connectivity
|
||||
are correctly configured.
|
||||
|
||||
The verified configuration establishes the reverse proxy
|
||||
routes. Certificate renewal and external firewall behavior
|
||||
should be verified separately rather than inferred from
|
||||
the Caddyfile alone.
|
||||
|
||||
\section{Gitea Integration and Webhooks}
|
||||
|
||||
\subsection{Repository and Jenkins Server}
|
||||
|
||||
The startup product source code is hosted on the team's
|
||||
self-managed Gitea instance at
|
||||
\url{https://git.nageshwaran.dev}.
|
||||
|
||||
The repository belongs to the organization
|
||||
\texttt{SSW590-Startup} and is named
|
||||
\texttt{startup-product}.
|
||||
|
||||
Jenkins is accessible through
|
||||
\url{https://ci.nageshwaran.dev}.
|
||||
|
||||
The Jenkins Gitea integration was configured with a
|
||||
Gitea server entry named \texttt{SSW590-Gitea}.
|
||||
An API credential identified as
|
||||
\texttt{ssw590-gitea-token} is stored in the
|
||||
Jenkins credential store rather than in the
|
||||
version-controlled application source.
|
||||
|
||||
\subsection{Multibranch Pipeline}
|
||||
|
||||
The Jenkins multibranch pipeline is identified by
|
||||
\texttt{startup-product-gitea-ci}.
|
||||
|
||||
The pipeline discovers repository branches and pull
|
||||
requests and executes the version-controlled
|
||||
\texttt{Jenkinsfile} associated with each build.
|
||||
|
||||
The pipeline provides continuous integration checks
|
||||
for changes proposed to the protected main branch.
|
||||
|
||||
\subsection{Webhook-Triggered Builds}
|
||||
|
||||
Gitea webhooks notify Jenkins when relevant repository
|
||||
events occur, including updates to pull requests.
|
||||
|
||||
This integration was tested during pull request
|
||||
\#8, titled ``Add Jenkins CI pipeline and automated
|
||||
Node.js tests.''
|
||||
|
||||
Jenkins executed builds after changes were pushed
|
||||
to the pull request, and their results were reported
|
||||
back to Gitea as commit status checks.
|
||||
|
||||
A deliberately failing test produced a failed
|
||||
status. After the test was corrected, Jenkins
|
||||
reported a successful status, allowing the reviewed
|
||||
pull request to proceed through the merge workflow.
|
||||
|
||||
\subsection{Integration Verification}
|
||||
|
||||
The integration was verified through Jenkins build
|
||||
results, Gitea pull request status checks, and
|
||||
the successful Jenkins build of the main branch
|
||||
following the merge.
|
||||
|
||||
The final main-branch build completed successfully
|
||||
with two passing automated tests and zero failures.
|
||||
|
||||
\section{Version-Controlled Jenkins Pipeline}
|
||||
|
||||
The continuous integration pipeline is defined in a
|
||||
\texttt{Jenkinsfile} stored at the root of the
|
||||
\texttt{startup-product} repository.
|
||||
|
||||
Using a version-controlled Jenkinsfile ensures that
|
||||
pipeline changes are reviewed and tracked alongside
|
||||
the application source code.
|
||||
|
||||
\subsection{Pipeline Execution Controls}
|
||||
|
||||
The pipeline uses the Jenkins declarative pipeline
|
||||
syntax with \texttt{agent any}.
|
||||
|
||||
The following execution controls are configured:
|
||||
|
||||
\begin{itemize}
|
||||
\item Concurrent builds are disabled using
|
||||
\texttt{disableConcurrentBuilds()}.
|
||||
\item A five-minute timeout prevents indefinitely
|
||||
running builds.
|
||||
\item Build history is limited to the five most recent
|
||||
builds using \texttt{buildDiscarder}.
|
||||
\end{itemize}
|
||||
|
||||
\subsection{Pipeline Stages}
|
||||
|
||||
The Jenkinsfile defines four sequential stages:
|
||||
|
||||
\begin{enumerate}
|
||||
\item \textbf{Checkout:} Retrieves the repository
|
||||
revision associated with the Jenkins build using
|
||||
\texttt{checkout scm}.
|
||||
|
||||
\item \textbf{Verify Node.js:} Executes
|
||||
\texttt{node --version} and \texttt{npm --version}
|
||||
to verify that the required tools are available.
|
||||
|
||||
\item \textbf{Syntax Check:} Changes into the
|
||||
\texttt{app} directory and executes
|
||||
\texttt{npm run check}.
|
||||
|
||||
\item \textbf{Automated Tests:} Executes
|
||||
\texttt{npm test} from the \texttt{app} directory.
|
||||
\end{enumerate}
|
||||
|
||||
\subsection{Node.js Project Scripts}
|
||||
|
||||
The application defines its validation commands in
|
||||
\texttt{app/package.json}:
|
||||
|
||||
\begin{verbatim}
|
||||
"scripts": {
|
||||
"test": "node --test",
|
||||
"check": "node --check src/health.js"
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
The syntax-check command uses Node.js to validate
|
||||
the JavaScript syntax of \texttt{src/health.js}.
|
||||
|
||||
The test command uses the built-in Node.js test runner
|
||||
to execute the project's automated tests.
|
||||
|
||||
\subsection{Build Result Reporting}
|
||||
|
||||
The Jenkinsfile includes post-build handlers for
|
||||
successful and failed executions.
|
||||
|
||||
On success, Jenkins prints:
|
||||
|
||||
\begin{verbatim}
|
||||
CI PASSED: All checks completed successfully.
|
||||
\end{verbatim}
|
||||
|
||||
On failure, Jenkins prints:
|
||||
|
||||
\begin{verbatim}
|
||||
CI FAILED: Review the Jenkins console output.
|
||||
\end{verbatim}
|
||||
|
||||
These messages supplement the Jenkins build status
|
||||
and console output.
|
||||
|
||||
\section{Automated Tests and CI Verification}
|
||||
|
||||
\subsection{Application Health-Check Function}
|
||||
|
||||
The startup product includes a health-check function
|
||||
in \texttt{app/src/health.js}.
|
||||
|
||||
The function \texttt{getHealthStatus} accepts a Boolean
|
||||
parameter representing database connectivity and returns
|
||||
an object containing the application status and database
|
||||
connection state.
|
||||
|
||||
When database connectivity is true, the function returns
|
||||
\texttt{healthy} and \texttt{connected}. When connectivity
|
||||
is false, it returns \texttt{unhealthy} and
|
||||
\texttt{disconnected}.
|
||||
|
||||
\subsection{Automated Unit Tests}
|
||||
|
||||
The test file \texttt{app/test/health.test.js} uses
|
||||
the built-in Node.js test runner and strict assertions.
|
||||
|
||||
Two automated test cases are implemented:
|
||||
|
||||
\begin{enumerate}
|
||||
\item \textbf{Connected database:} Calling
|
||||
\texttt{getHealthStatus(true)} must return an object
|
||||
with status \texttt{healthy} and database state
|
||||
\texttt{connected}.
|
||||
|
||||
\item \textbf{Disconnected database:} Calling
|
||||
\texttt{getHealthStatus(false)} must return an object
|
||||
with status \texttt{unhealthy} and database state
|
||||
\texttt{disconnected}.
|
||||
\end{enumerate}
|
||||
|
||||
These tests validate the application's response to
|
||||
simulated database connectivity states. They do not
|
||||
establish connectivity to a live database server.
|
||||
|
||||
\subsection{Jenkins Test Execution}
|
||||
|
||||
The automated test stage runs the following command
|
||||
inside the application directory:
|
||||
|
||||
\begin{verbatim}
|
||||
npm test
|
||||
\end{verbatim}
|
||||
|
||||
The command invokes the Node.js test runner through
|
||||
the project's \texttt{package.json} configuration.
|
||||
|
||||
During the verified successful Jenkins main-branch
|
||||
build, both automated tests passed with zero failures.
|
||||
|
||||
The successful build also completed the Node.js
|
||||
verification and JavaScript syntax-check stages.
|
||||
|
||||
\subsection{Continuous Integration Result}
|
||||
|
||||
The Jenkins multibranch pipeline reported a successful
|
||||
main-branch build after pull request \#8 was reviewed
|
||||
and merged.
|
||||
|
||||
The verified Jenkins main-branch build was build
|
||||
number \#1, which completed in approximately
|
||||
33 seconds with two passing tests and zero failures.
|
||||
|
||||
The build console is available at:
|
||||
|
||||
\begin{quote}
|
||||
\url{https://ci.nageshwaran.dev/job/startup-product-gitea-ci/job/main/1/console}
|
||||
\end{quote}
|
||||
|
||||
\section{Failed Build and Successful Recovery}
|
||||
|
||||
\subsection{Controlled Failure Experiment}
|
||||
|
||||
To demonstrate that the continuous integration pipeline
|
||||
detects incorrect application behavior, the team
|
||||
deliberately introduced an incorrect expected result
|
||||
into an automated health-check test.
|
||||
|
||||
The change was pushed to the feature branch
|
||||
\texttt{feature/jenkins-ci}, associated with Gitea
|
||||
pull request \#8.
|
||||
|
||||
The failing commit was identified by the abbreviated
|
||||
Git SHA \texttt{e1d9007}.
|
||||
|
||||
The Gitea webhook triggered Jenkins to execute the
|
||||
pipeline against the updated pull request.
|
||||
|
||||
Jenkins pull-request build \#2 failed because the
|
||||
automated test assertion did not match the application's
|
||||
actual result.
|
||||
|
||||
The failed Jenkins status was reported to Gitea,
|
||||
demonstrating that the CI integration detected the
|
||||
deliberately introduced defect.
|
||||
|
||||
\subsection{Corrective Commit}
|
||||
|
||||
The team corrected the failing test expectation and
|
||||
pushed the repaired implementation to the same
|
||||
feature branch.
|
||||
|
||||
The corrective commit was identified by the
|
||||
abbreviated Git SHA \texttt{e00142a}.
|
||||
|
||||
The subsequent Jenkins pull-request build \#3
|
||||
completed successfully.
|
||||
|
||||
The pipeline executed the syntax check and automated
|
||||
tests, and Jenkins reported a successful result
|
||||
back to Gitea.
|
||||
|
||||
\subsection{Failure and Recovery Results}
|
||||
|
||||
The observed results are summarized below:
|
||||
|
||||
\begin{center}
|
||||
\begin{tabular}{llll}
|
||||
\toprule
|
||||
Revision & Jenkins Build & Result & Purpose \\
|
||||
\midrule
|
||||
\texttt{e1d9007} & PR-8 \#2 & FAILURE & Deliberate defect \\
|
||||
\texttt{e00142a} & PR-8 \#3 & SUCCESS & Corrected test \\
|
||||
\bottomrule
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
This controlled failure-and-recovery experiment
|
||||
demonstrates that the Jenkins pipeline does not
|
||||
simply execute automatically; it can identify
|
||||
an incorrect test expectation and confirm that
|
||||
the correction restores the passing status.
|
||||
|
||||
\section{Branch Protection and Required Status Checks}
|
||||
|
||||
\subsection{Protected Main Branch}
|
||||
|
||||
The Gitea repository was configured with branch
|
||||
protection for \texttt{main}.
|
||||
|
||||
The purpose of this protection is to ensure that
|
||||
changes are validated by the Jenkins continuous
|
||||
integration pipeline before being merged into
|
||||
the main development branch.
|
||||
|
||||
\subsection{Required Jenkins Status Check}
|
||||
|
||||
The required CI status check was configured as:
|
||||
|
||||
\begin{verbatim}
|
||||
startup-product-gitea-ci/pipeline/pr-main
|
||||
\end{verbatim}
|
||||
|
||||
This status check connects Jenkins build results
|
||||
to the Gitea pull request merge workflow.
|
||||
|
||||
A failing Jenkins build prevents the required
|
||||
status check from being satisfied.
|
||||
|
||||
\subsection{Verification Using Pull Request 8}
|
||||
|
||||
During pull request \#8, the deliberately failing
|
||||
test caused Jenkins PR build \#2 to report
|
||||
\texttt{FAILURE}.
|
||||
|
||||
Gitea displayed the unsuccessful status, and
|
||||
the pull request could not satisfy the required
|
||||
CI check.
|
||||
|
||||
After the corrective commit was pushed, Jenkins
|
||||
PR build \#3 reported \texttt{SUCCESS}.
|
||||
|
||||
The required status check became successful,
|
||||
allowing the pull request to proceed through
|
||||
the review and merge workflow.
|
||||
|
||||
This verifies that the required CI status check
|
||||
was enforced during the demonstrated workflow.
|
||||
|
||||
\section{Pull Request Review and Merge}
|
||||
|
||||
\subsection{Pull Request Creation}
|
||||
|
||||
The Jenkins CI implementation was developed on the
|
||||
feature branch \texttt{feature/jenkins-ci}.
|
||||
|
||||
The changes were submitted to Gitea through
|
||||
pull request \#8, titled:
|
||||
|
||||
\begin{quote}
|
||||
Add Jenkins CI pipeline and automated Node.js tests
|
||||
\end{quote}
|
||||
|
||||
The pull request proposed merging the feature branch
|
||||
into the protected \texttt{main} branch.
|
||||
|
||||
The changes included the version-controlled
|
||||
Jenkinsfile, Node.js project configuration,
|
||||
application health-check implementation, and
|
||||
automated tests.
|
||||
|
||||
\subsection{Continuous Integration Validation}
|
||||
|
||||
Jenkins automatically validated changes associated
|
||||
with pull request \#8.
|
||||
|
||||
An intentionally incorrect test expectation caused
|
||||
Jenkins pull-request build \#2 to fail.
|
||||
|
||||
After the corrective commit was pushed, Jenkins
|
||||
pull-request build \#3 completed successfully.
|
||||
|
||||
Gitea displayed the successful required status check:
|
||||
|
||||
\begin{verbatim}
|
||||
startup-product-gitea-ci/pipeline/pr-main
|
||||
\end{verbatim}
|
||||
|
||||
\subsection{Reviewer Approval}
|
||||
|
||||
The pull request was reviewed by the team member
|
||||
using the Gitea account \texttt{shiv}.
|
||||
|
||||
The reviewer inspected the five changed files
|
||||
and submitted an approval through Gitea's
|
||||
pull request review interface.
|
||||
|
||||
The approval was recorded before the pull
|
||||
request was merged.
|
||||
|
||||
\subsection{Merge into Main}
|
||||
|
||||
After Jenkins reported a successful required
|
||||
status check and the reviewer approved the
|
||||
changes, pull request \#8 was merged into
|
||||
the \texttt{main} branch.
|
||||
|
||||
The resulting merge commit was:
|
||||
|
||||
\begin{verbatim}
|
||||
b2cdc5cad4d522a36160f738c0befbb6d86cbda0
|
||||
\end{verbatim}
|
||||
|
||||
\subsection{Post-Merge Verification}
|
||||
|
||||
After the merge, the Jenkins multibranch
|
||||
pipeline detected the updated \texttt{main}
|
||||
branch and executed a new build.
|
||||
|
||||
Jenkins main-branch build \#1 completed
|
||||
successfully in approximately 33 seconds.
|
||||
|
||||
The console output confirmed:
|
||||
|
||||
\begin{itemize}
|
||||
\item Node.js and npm verification completed.
|
||||
\item JavaScript syntax checking succeeded.
|
||||
\item Both automated health tests passed.
|
||||
\item Zero automated test failures were reported.
|
||||
\item The final pipeline result was \texttt{SUCCESS}.
|
||||
\end{itemize}
|
||||
|
||||
This confirms that the merged source code
|
||||
passed the automated Jenkins validation
|
||||
on the main branch.
|
||||
|
||||
\section{Security, Credentials, and Trust Boundaries}
|
||||
|
||||
\subsection{Credential Management}
|
||||
|
||||
Jenkins integrates with the self-hosted Gitea server
|
||||
using an API credential stored in the Jenkins
|
||||
credential store.
|
||||
|
||||
The credential identifier is:
|
||||
|
||||
\begin{verbatim}
|
||||
ssw590-gitea-token
|
||||
\end{verbatim}
|
||||
|
||||
The API token value is not included in the
|
||||
Jenkinsfile, application source code, or this manual.
|
||||
|
||||
Credentials should be rotated if exposed, and
|
||||
replacement values must be updated in Jenkins.
|
||||
|
||||
\subsection{Public and Private Network Boundaries}
|
||||
|
||||
The public Jenkins endpoint is:
|
||||
|
||||
\begin{verbatim}
|
||||
https://ci.nageshwaran.dev
|
||||
\end{verbatim}
|
||||
|
||||
Caddy routes HTTPS requests to the Jenkins container
|
||||
using the internal Docker service address
|
||||
\texttt{jenkins:8080}.
|
||||
|
||||
Jenkins publishes its application port only on
|
||||
the Droplet's loopback interface:
|
||||
|
||||
\begin{verbatim}
|
||||
127.0.0.1:8080:8080
|
||||
\end{verbatim}
|
||||
|
||||
This avoids publishing the Jenkins application
|
||||
port directly on the Droplet's public interface.
|
||||
|
||||
\subsection{Repository and Pipeline Trust}
|
||||
|
||||
The Jenkinsfile is stored in the Gitea repository
|
||||
and executed by Jenkins during continuous
|
||||
integration builds.
|
||||
|
||||
Changes to the Jenkinsfile can affect the commands
|
||||
executed by the Jenkins build agent.
|
||||
|
||||
Therefore, repository write access, pull request
|
||||
review, and branch protection are important
|
||||
security controls.
|
||||
|
||||
The demonstrated workflow used a protected
|
||||
main branch, a required Jenkins status check,
|
||||
and a separate reviewer approval before merging
|
||||
pull request \#8.
|
||||
|
||||
\subsection{Resource and Operational Boundaries}
|
||||
|
||||
The Jenkins container uses a 384 MiB memory limit
|
||||
and a maximum Java heap of 192 MiB.
|
||||
|
||||
These resource limits help control consumption
|
||||
on the small DigitalOcean Droplet.
|
||||
|
||||
The container restart policy is \texttt{no},
|
||||
so Jenkins requires an explicit start after
|
||||
a container stop or host restart.
|
||||
|
||||
The persistent Jenkins home directory is stored at:
|
||||
|
||||
\begin{verbatim}
|
||||
/opt/jenkins/jenkins_home
|
||||
\end{verbatim}
|
||||
|
||||
Administrators must protect this directory because
|
||||
it contains Jenkins configuration and sensitive
|
||||
application state.
|
||||
|
||||
\subsection{Security Limitations}
|
||||
|
||||
The verified configuration demonstrates localhost-only
|
||||
port publishing, Docker network separation,
|
||||
credential-store usage, and branch protection.
|
||||
|
||||
These controls do not by themselves prove complete
|
||||
host hardening or eliminate risks from untrusted
|
||||
pipeline code.
|
||||
|
||||
API token rotation, firewall verification, software
|
||||
updates, and access-control reviews remain important
|
||||
operational responsibilities.
|
||||
|
||||
\section{Screenshot Evidence}
|
||||
|
||||
The following figures record the observed Jenkins and Gitea CI workflow.
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/jenkins_dashboard.png}
|
||||
\caption{Jenkins dashboard showing the configured CI jobs.}
|
||||
\label{fig:jenkins-dashboard}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/jenkins_failed_build.png}
|
||||
\caption{Jenkins PR 8 build 2: one automated test failed and Jenkins reported FAILURE to Gitea.}
|
||||
\label{fig:jenkins-failed}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/jenkins_successful_build.png}
|
||||
\caption{Jenkins PR 8 build 3: both automated tests passed and Jenkins reported SUCCESS.}
|
||||
\label{fig:jenkins-recovery}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/gitea_pr8_merged.png}
|
||||
\caption{Gitea pull request 8 merged from the Jenkins feature branch into main.}
|
||||
\label{fig:gitea-pr8-merged}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/gitea_pr8_approval.png}
|
||||
\caption{Gitea reviewer approval and merge activity for pull request 8.}
|
||||
\label{fig:gitea-pr8-approval}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/jenkins_main_success.png}
|
||||
\caption{Post-merge Jenkins main branch build 1: two tests passed with zero failures.}
|
||||
\label{fig:jenkins-main-success}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/gitea_branch_protection.png}
|
||||
\caption{Gitea repository branch protection rule for main.}
|
||||
\label{fig:gitea-branch-protection}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}[H]
|
||||
\centering
|
||||
\includegraphics[width=0.92\linewidth]{img/gitea_required_ci_check.png}
|
||||
\caption{Gitea branch protection requiring the Jenkins pr-main status check.}
|
||||
\label{fig:gitea-required-check}
|
||||
\end{figure}
|
||||
|
||||
\section{Operations and Verification Evidence}
|
||||
|
||||
\subsection{Routine Jenkins Operations}
|
||||
|
||||
Jenkins is managed through Docker Compose on the
|
||||
DigitalOcean Droplet. The Compose project is located
|
||||
at \texttt{/opt/jenkins}.
|
||||
|
||||
The following commands provide routine operational
|
||||
control and inspection:
|
||||
|
||||
\begin{verbatim}
|
||||
cd /opt/jenkins
|
||||
|
||||
# Inspect container status
|
||||
docker compose ps
|
||||
|
||||
# Start Jenkins
|
||||
docker compose up -d
|
||||
|
||||
# Stop Jenkins
|
||||
docker compose stop
|
||||
|
||||
# Inspect recent logs
|
||||
docker compose logs --tail=100 jenkins
|
||||
|
||||
# Verify effective configuration
|
||||
docker compose config
|
||||
\end{verbatim}
|
||||
|
||||
The commands above are documented operational procedures;
|
||||
they are not all claimed as separately executed tests.
|
||||
|
||||
\subsection{Persistence and Recovery}
|
||||
|
||||
The Jenkins home directory is stored on the host at
|
||||
\texttt{/opt/jenkins/jenkins\_home}.
|
||||
|
||||
This bind mount preserves Jenkins application data
|
||||
independently of the container writable layer.
|
||||
|
||||
Before container replacement or configuration changes,
|
||||
administrators should back up the Jenkins home directory
|
||||
and the Docker Compose configuration.
|
||||
|
||||
Because the restart policy is \texttt{no}, Jenkins
|
||||
must be explicitly started after a host restart.
|
||||
|
||||
\subsection{Troubleshooting Procedure}
|
||||
|
||||
If Jenkins becomes unavailable, the administrator
|
||||
should first inspect the container state and logs:
|
||||
|
||||
\begin{verbatim}
|
||||
cd /opt/jenkins
|
||||
docker compose ps
|
||||
docker compose logs --tail=100 jenkins
|
||||
\end{verbatim}
|
||||
|
||||
If the container is running but the public Jenkins
|
||||
hostname is unavailable, the administrator should
|
||||
inspect Caddy, DNS, HTTPS certificate status, and
|
||||
Docker network connectivity.
|
||||
|
||||
If a pipeline fails, the Jenkins console output
|
||||
should be inspected to identify the failing stage.
|
||||
|
||||
The controlled failure experiment in pull request
|
||||
\#8 demonstrates this diagnostic workflow.
|
||||
|
||||
\subsection{Verified Continuous Integration Evidence}
|
||||
|
||||
The following results were observed during the
|
||||
Jenkins and Gitea integration exercise:
|
||||
|
||||
\begin{enumerate}
|
||||
\item Jenkins ran using the custom Docker image
|
||||
\texttt{jenkins-node:2.580.1}.
|
||||
|
||||
\item Docker Compose confirmed persistent storage,
|
||||
resource limits, and localhost-only port publishing.
|
||||
|
||||
\item Caddy routed the Jenkins hostname to
|
||||
\texttt{jenkins:8080}.
|
||||
|
||||
\item Gitea webhook events triggered Jenkins
|
||||
pull-request builds.
|
||||
|
||||
\item Pull request \#8 produced a deliberately
|
||||
failed Jenkins build \#2.
|
||||
|
||||
\item A corrective commit produced successful
|
||||
Jenkins pull-request build \#3.
|
||||
|
||||
\item Gitea displayed the required Jenkins
|
||||
status check as successful.
|
||||
|
||||
\item Reviewer \texttt{shiv} approved the pull
|
||||
request before it was merged.
|
||||
|
||||
\item The merged main branch passed Jenkins
|
||||
build \#1 with two passing automated tests
|
||||
and zero failures.
|
||||
\end{enumerate}
|
||||
|
||||
\subsection{Evidence and Submission Controls}
|
||||
|
||||
Screenshots of the actual Docker deployment,
|
||||
Jenkins pipeline stages, failed and successful
|
||||
builds, Gitea required status check, reviewer
|
||||
approval, and merged pull request should be
|
||||
included in the final manual.
|
||||
|
||||
Each screenshot must correspond to an actual
|
||||
observed result and include an explanatory caption.
|
||||
|
||||
Sensitive credentials, API tokens, private keys,
|
||||
and passwords must not appear in the submitted PDF.
|
||||
|
||||
The final compiled manual should be checked for
|
||||
correct chapter ordering, figure references,
|
||||
document history, and successful LaTeX compilation.
|
||||
|
||||
|
After Width: | Height: | Size: 268 KiB |
|
After Width: | Height: | Size: 439 KiB |
|
After Width: | Height: | Size: 464 KiB |
|
After Width: | Height: | Size: 385 KiB |
|
After Width: | Height: | Size: 212 KiB |
|
After Width: | Height: | Size: 272 KiB |
|
After Width: | Height: | Size: 277 KiB |
|
After Width: | Height: | Size: 278 KiB |
@@ -9,7 +9,7 @@
|
||||
\setlength{\parskip}{4pt}\setlength{\parindent}{0pt}
|
||||
\captionsetup{font=small,labelfont=bf}
|
||||
\pagestyle{fancy}\fancyhf{}
|
||||
\fancyhead[L]{SSW 590 DevOps IT Manual}\fancyhead[R]{Version 1.3}\fancyfoot[C]{\thepage}\fancyfoot[R]{\small Stevens Institute of Technology}
|
||||
\fancyhead[L]{SSW 590 DevOps IT Manual}\fancyhead[R]{Version 1.4}\fancyfoot[C]{\thepage}\fancyfoot[R]{\small Stevens Institute of Technology}
|
||||
\lstset{basicstyle=\ttfamily\footnotesize,breaklines=true,frame=single,backgroundcolor=\color{black!4},columns=fullflexible,keepspaces=true,showstringspaces=false}
|
||||
\newcommand{\vok}{\textcolor{green!45!black}{\textbf{VERIFIED}}}
|
||||
\newcommand{\vpart}{\textcolor{orange!85!black}{\textbf{PARTIAL}}}
|
||||
@@ -29,10 +29,10 @@
|
||||
{\Large SSW 590 --- DevOps\par}\vspace{1cm}
|
||||
{\Huge\bfseries DevOps IT Manual\par}\vspace{.4cm}
|
||||
{\LARGE Startup Foundation with Gitea\par}\vspace{1.2cm}
|
||||
{\large Version 1.3\par}{\large Student Edition\par}\vspace{1.5cm}
|
||||
{\large Version 1.4\par}{\large Student Edition\par}\vspace{1.5cm}
|
||||
{\large Nageshwaran Manikumar and Shiv Patel\par}\vspace{.6cm}
|
||||
Instructor: Darian Muresan\par Stevens Institute of Technology\par\vspace{.6cm}
|
||||
October 9, 2026\par\vspace{1.5cm}
|
||||
October 23, 2026\par\vspace{1.5cm}
|
||||
\textbf{Gitea:} \url{https://git.nageshwaran.dev}\par
|
||||
\textbf{Product repository:} \url{https://git.nageshwaran.dev/SSW590-Startup/startup-product}\par
|
||||
\textbf{Build identifier:} \BuildIdentifier\par
|
||||
@@ -50,6 +50,7 @@ Newest entry first. Entries 1.0 and 1.1 are reconstructed from the timestamps on
|
||||
\begin{tabularx}{\linewidth}{@{}p{1.9cm}p{1.1cm}p{1.5cm}Y p{2.4cm}@{}}
|
||||
\toprule
|
||||
Date / Ver. & Author & Change & Details & Changed at\\\midrule
|
||||
Oct 23, 2026 / 1.4 & NM, SP & Jenkins CI integration & Documented Jenkins deployment, persistent storage, HTTPS reverse proxy, Gitea webhooks, version-controlled pipeline, automated tests, failed and recovered builds, required status checks, reviewer approval, and merge verification. Added eight screenshot figures. & Ch.~4 \\ \addlinespace
|
||||
Oct 9, 2026 / 1.3 & NM, SP & Gitea Actions automation & Added external Mac runner, pinned TeX Live/Node image, build metadata, PDF artifact, two successful source changes and failure/repair evidence. \textbf{Hosts and Passwords tables updated} with runner and secret-handling information. & Ch.~1, Ch.~3 \\\addlinespace
|
||||
Oct 2, 2026 / 1.2 & NM, SP & Gitea chapter completed & Added all eight Gitea subsections; SSH restricted to one approved source IP in the Cloud Firewall; organization, repository, five issues and two reviewed/merged pull requests documented. \textbf{Hosts table and Passwords table updated} (firewall rule, Gitea accounts, 2FA status). & Ch.~1, Ch.~2 \\\addlinespace
|
||||
Sep 30, 2026 / 1.1 & NM & Gitea first deployment & Gitea 1.27.3-rootless and Caddy 2.10.2 deployed with Docker Compose; hostname \texttt{git.nageshwaran.dev}; Let's Encrypt certificate; persistence test. \textbf{Hosts table updated.} & Ch.~1, \S\ref{sec:deploy}--\ref{sec:https} \\\addlinespace
|
||||
@@ -69,6 +70,7 @@ Hostname & Role / env. & Provider / address & Exposed ports & Owner & HTTPS URL
|
||||
\texttt{ubuntu-s-1vcpu-\allowbreak512mb-\allowbreak10gb-nyc1} (Droplet) & Docker host, admin & DigitalOcean; public 143.244.173.110, private 10.10.0.5; 1 vCPU / 512 MB / 10 GB; Ubuntu 24.04.4 & 22/tcp only from 174.167.120.67/32 (Cloud Firewall \texttt{ssw590-gitea-firewall}) & NM & n/a & DO Droplet backups not enabled (not evidenced)\\\addlinespace
|
||||
\texttt{gitea}, \texttt{caddy} (containers) & Internal services & Docker network \texttt{gitea\_internal} & None published except Caddy 80/443; Gitea 3000 and 2222 internal only & NM & n/a & n/a\\
|
||||
\addlinespace
|
||||
\texttt{ci.nageshwaran.dev} & Jenkins CI service, production (class) & DigitalOcean NYC1; 143.244.173.110 & HTTPS through Caddy on 443/tcp; Jenkins 8080 bound to \texttt{127.0.0.1} on host & NM & \url{https://ci.nageshwaran.dev} & Persistent \texttt{/opt/jenkins/jenkins\_home}; no verified off-host backup or monitoring \\ \addlinespace
|
||||
\texttt{macbook-latex-runner} & Repository-scoped Actions runner & Team Mac, Apple Silicon, Colima Docker engine & No inbound public runner port; outbound HTTPS to Gitea & NM & \url{https://git.nageshwaran.dev} & Local runner, availability depends on Mac \\
|
||||
\bottomrule\end{tabularx}\end{center}
|
||||
|
||||
@@ -85,6 +87,8 @@ DigitalOcean account & NM & Account password in owner's password manager. & Acco
|
||||
Domain registrar account & NM & Account password in owner's password manager. & Domain owner & MFA status not evidenced\\
|
||||
Let's Encrypt / Caddy ACME account & NM & No human password; account key stored in \texttt{caddy\_data} volume on the Droplet. & n/a & Managed by Caddy\\
|
||||
\addlinespace
|
||||
Jenkins administrator & NM & Administrator credential managed outside the repository and report. & Jenkins administration & MFA and rotation not evidenced \\
|
||||
Jenkins Gitea API integration & NM & Jenkins credential ID \texttt{ssw590-gitea-token}; token value excluded. & Gitea API integration & Rotate if exposed; rotation not verified \\ \addlinespace
|
||||
Gitea runner registration & NM & Token and runner credential file stored outside repository; local \texttt{\string~/gitea-runner/.runner} has restricted permissions & Repository runner & Rotate token if exposed; never print credentials \\
|
||||
\bottomrule\end{tabularx}\end{center}
|
||||
|
||||
@@ -427,6 +431,8 @@ The runner credential file remains on the Mac outside Git and has restricted per
|
||||
\section{Manual Quality and Controls}
|
||||
The earlier Gitea deployment and screenshot evidence remain in Chapters 1--2. Chapter 3 documents the runner, compilation, version traceability, artifact and controlled failure/repair. The latest document history entry explicitly records the Hosts and Passwords table changes. Evidence links are provided above; dated screenshots of the runner page, run logs, artifact listing and final PDF cover should be added before final submission. The final submission must be the artifact from the final successful Actions run, and the title-page run identity must match that run.
|
||||
|
||||
\input{chapters/chapter4}
|
||||
|
||||
\appendix
|
||||
\chapter{Glossary}
|
||||
\begin{description}[nosep]
|
||||
|
||||