4 Commits

Author SHA1 Message Date
kholmes 9a2f01e304 updated date
Scrap-Web/pipeline/head This commit looks good
2026-10-24 10:27:47 +00:00
kholmes 11a56df599 updated doc history
Scrap-Web/pipeline/head This commit looks good
2026-10-24 10:27:02 +00:00
kholmes 53acd95e27 added images
Scrap-Web/pipeline/head This commit looks good
2026-10-24 10:25:03 +00:00
kholmes 5854a35003 manual merge of versions
Scrap-Web/pipeline/head This commit looks good
2026-10-24 10:20:18 +00:00
21 changed files with 254 additions and 891 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

+1 -1
View File
@@ -40,7 +40,7 @@
\newcommand{\CourseName}{DevOps} \newcommand{\CourseName}{DevOps}
\newcommand{\Instructor}{Samah Keshiro and Kayla Holmes} \newcommand{\Instructor}{Samah Keshiro and Kayla Holmes}
\newcommand{\Organization}{Stevens Institute of Technology} \newcommand{\Organization}{Stevens Institute of Technology}
\newcommand{\DocumentDate}{10/10/26} \newcommand{\DocumentDate}{10/23/26}
\newcommand{\DueDate}{[Due Date and Time]} \newcommand{\DueDate}{[Due Date and Time]}
\newcommand{\VERSION}{Version 1.5} \newcommand{\VERSION}{Version 1.5}
\newcommand{\AssignmentNumber}{5} \newcommand{\AssignmentNumber}{5}
+252 -64
View File
@@ -36,7 +36,7 @@ networks:
name: gitea-net name: gitea-net
\end{minted} \end{minted}
\noindent\textbf{Configuration file:} \texttt{/root/jenkins/docker-compose.yml} on the Droplet. Add the URL to the source-controlled Compose file here: \url{[INSERT COMPOSE FILE LINK]}. \noindent\textbf{Configuration file:} \texttt{/root/jenkins/docker-compose.yml} on the Droplet. The source-controlled copy is at \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/deployment/docker-compose.yml}.
The container uses the external Docker network \texttt{gitea-net}, which allows Jenkins to communicate with the existing Gitea and Caddy services. Jenkins listens on container port 8080, but the Compose configuration does not publish port 8080 or the Jenkins agent port 50000 directly on the host. Browser access is provided through Caddy using the HTTPS address \url{https://ci.ssw590-08.me/}. The container uses the external Docker network \texttt{gitea-net}, which allows Jenkins to communicate with the existing Gitea and Caddy services. Jenkins listens on container port 8080, but the Compose configuration does not publish port 8080 or the Jenkins agent port 50000 directly on the host. Browser access is provided through Caddy using the HTTPS address \url{https://ci.ssw590-08.me/}.
@@ -101,7 +101,7 @@ Jenkins is accessible through the following HTTPS address:
The hostname \texttt{ci.ssw590-08.me} resolves to the public IP address of the DigitalOcean Droplet hosting the DevOps services. Jenkins is not intended to be accessed through a publicly exposed container port. Instead, incoming browser requests reach the Caddy reverse proxy, which forwards requests to the Jenkins service over the shared Docker network. The hostname \texttt{ci.ssw590-08.me} resolves to the public IP address of the DigitalOcean Droplet hosting the DevOps services. Jenkins is not intended to be accessed through a publicly exposed container port. Instead, incoming browser requests reach the Caddy reverse proxy, which forwards requests to the Jenkins service over the shared Docker network.
The instructor-approved access path for this deployment is: \textbf{[INSERT THE ACCESS METHOD APPROVED BY THE INSTRUCTOR]}. Access was verified by opening the HTTPS login page in a browser on \textbf{[INSERT VERIFICATION DATE]}. The instructor-approved access path for this deployment is \textbf{HTTPS}, through the Caddy reverse proxy. Access was verified by opening the HTTPS login page in a browser on \textbf{[10/23/2026]}.
\subsection{DNS and TLS Certificate} \subsection{DNS and TLS Certificate}
@@ -122,9 +122,9 @@ The certificate details should be recorded from the certificate actually present
\begin{itemize} \begin{itemize}
\item \textbf{Hostname:} \texttt{ci.ssw590-08.me} \item \textbf{Hostname:} \texttt{ci.ssw590-08.me}
\item \textbf{Certificate issuer:} [INSERT VERIFIED CERTIFICATE ISSUER] \item \textbf{Certificate issuer:} Caddy (automatic certificate management)
\item \textbf{Certificate expiration:} [INSERT VERIFIED EXPIRATION DATE] \item \textbf{Certificate expiration:} January 20, 2027
\item \textbf{Certificate verification date:} [INSERT DATE] \item \textbf{Certificate verification date:} October 22, 2026
\end{itemize} \end{itemize}
Caddy supports automatic HTTPS certificate provisioning and renewal. The deployment uses Caddy for TLS termination, with its configuration and persistent data stored separately from the Jenkins container. The certificate issuer, expiration date, and renewal status should be verified from the active certificate and Caddy logs before this section is finalized. Caddy supports automatic HTTPS certificate provisioning and renewal. The deployment uses Caddy for TLS termination, with its configuration and persistent data stored separately from the Jenkins container. The certificate issuer, expiration date, and renewal status should be verified from the active certificate and Caddy logs before this section is finalized.
@@ -159,8 +159,8 @@ The Gitea integration uses a dedicated \texttt{jenkins} account and a Gitea Pers
The following account and role information should be completed based on the actual Jenkins security configuration: The following account and role information should be completed based on the actual Jenkins security configuration:
\begin{itemize} \begin{itemize}
\item \textbf{Jenkins administrators:} [INSERT AUTHORIZED ADMINISTRATOR ACCOUNTS OR ROLES] \item \textbf{Jenkins administrators:} \texttt{samahk} and \texttt{kaylah7}
\item \textbf{Jenkins users:} [INSERT AUTHORIZED USER ACCOUNTS OR ROLES] \item \textbf{Jenkins users:} \texttt{samahk} and \texttt{kaylah7}
\item \textbf{Gitea integration identity:} \texttt{jenkins} \item \textbf{Gitea integration identity:} \texttt{jenkins}
\item \textbf{Credential storage:} Jenkins Credentials \item \textbf{Credential storage:} Jenkins Credentials
\end{itemize} \end{itemize}
@@ -222,48 +222,76 @@ The expected results are:
\item \textbf{TCP 8080:} The connection should fail because Jenkins' internal web port is not published on the host and is not intended to be publicly accessible. \item \textbf{TCP 8080:} The connection should fail because Jenkins' internal web port is not published on the host and is not intended to be publicly accessible.
\end{itemize} \end{itemize}
Previous external tests of TCP ports 3000, 5432, 8080, and 50000 returned connection failures. These observations support the conclusion that those ports were not reachable from the test machine at that time. A separate dated test of TCP 443 and TCP 8080 should be included as direct evidence for this section. Previous external tests of TCP ports 3000, 5432, 8080, and 50000 returned connection failures.
The test record should include:
\begin{itemize} \begin{itemize}
\item \textbf{Test date and time:} [INSERT DATE, TIME, AND TIME ZONE] \item \textbf{Test date and time:} October 24, 2026, 4:25 AM EDT
\item \textbf{Test source:} [INSERT EXTERNAL MACHINE OR NETWORK] \item \textbf{Test source:} Shell on the Droplet itself (\texttt{root@devops-gitea-server}), connecting to its own public IPv4 address
\item \textbf{Droplet IPv4 address:} \texttt{147.182.179.191} \item \textbf{Droplet IPv4 address:} \texttt{147.182.179.191}
\item \textbf{TCP 443 result:} [INSERT OBSERVED RESULT] \item \textbf{TCP 443 result:} Succeeded (\texttt{nc} reported the connection to port 443 succeeded)
\item \textbf{TCP 8080 result:} [INSERT OBSERVED RESULT] \item \textbf{TCP 8080 result:} Failed with ``Connection refused,'' so nothing is listening on host port 8080
\end{itemize} \end{itemize}
A failed connection alone does not establish which control blocked it. The firewall configuration and Docker port inspection provide complementary evidence for the intended exposure restrictions. A failed connection alone does not establish which control blocked it. The firewall configuration and Docker port inspection provide complementary evidence for the intended exposure restrictions.
Figure~\ref{fig:ci-port-test} shows the test output. Because the test ran on the Droplet itself, it shows that Caddy answers on TCP 443 and that nothing listens on host port 8080; it does not exercise the cloud firewall. A failed connection alone does not establish which control blocked it. The firewall configuration and Docker port inspection provide complementary evidence for the intended exposure restrictions.
\begin{figure}[H]
\centering
\includegraphics[width=0.85\linewidth]{HW6 images/port-test.png}
\caption{10/24/26 \texttt{nc} test of TCP 443 (succeeded) and TCP 8080 (connection refused) against 147.182.179.191}
\label{fig:ci-port-test}
\end{figure}
\section{Gitea Trigger and Traceability} \section{Gitea Trigger and Traceability}
\label{sec:ci-trigger} \label{sec:ci-trigger}
\subsection{Deployment and Network Paths} \subsection{Deployment and Network Paths}
Figure~\ref{fig:ci-deployment} adapts the reference deployment to the team's The continuous integration workflow connects the Gitea repository
actual setup. Gitea and Jenkins run as containers on the same DigitalOcean \texttt{SSW-590-08/Scrap-Web} to Jenkins. The repository is hosted at
Droplet behind the Caddy TLS proxy. Two paths are separate: \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web}, and Jenkins is
accessible through \url{https://ci.ssw590-08.me/}. Jenkins uses the
Gitea integration to discover repository changes and report build
statuses associated with commits and pull requests.
A dedicated Gitea account named \texttt{jenkins} is used for the
integration. A Gitea Personal Access Token is stored in Jenkins'
credential store rather than being embedded in the workflow or
repository files. The account has repository access configured for
\texttt{SSW-590-08/Scrap-Web}. Administrative repository permission
was required to allow Jenkins to manage the repository webhook.
\begin{description}
\item[Repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web}
\item[Jenkins job:] \url{https://ci.ssw590-08.me/job/Scrap-Web/}, a
Multibranch Pipeline
\item[Integration account:] \texttt{jenkins-ci}, a dedicated Gitea account
used only by Jenkins
\item[Jenkins credential:] \texttt{gitea-jenkins-ci} (type: Gitea Personal
Access Token)
\end{description}
Jenkins does not use a team member's personal account. The
\texttt{jenkins-ci} account was created by the Gitea site administrator for
this integration and limited to what Jenkins needs:
\begin{itemize} \begin{itemize}
\item \textbf{Browser path:} a team member's browser reaches \item it is a \emph{restricted} account, so it can see only repositories it
\url{https://ci.ssw590-08.me} on port 443 through the Cloud Firewall and is explicitly added to, and it is not a site administrator;
Caddy, which forwards to Jenkins on the private Docker network. Jenkins' \item it is a collaborator on Scrap-Web only, with \emph{Write} access.
own port 8080 is not published (Section~\ref{sec:ci-https}). Write is the minimum Gitea requires to set commit statuses. It cannot
\item \textbf{Integration path:} Jenkins initiates every connection to push to \texttt{main}, which is protected (Section~\ref{sec:ci-gate});
Gitea. It calls the Gitea API at \url{https://git.ssw590-08.me} to \item its token, named \texttt{jenkins}, has the scopes
discover branches and pull requests, clones the pull request's head \texttt{write:repository}, \texttt{read:organization}, and \texttt{read:user}. The
commit, and posts the commit status back. Gitea never needs to reach token value is stored only in the Jenkins credential store
Jenkins for builds to run, because the job polls for changes (Section~\ref{sec:ci-credentials}).
(Section~\ref{sec:ci-trigger-config}).
\end{itemize} \end{itemize}
\begin{figure}[H] \begin{figure}[H]
\centering \centering
% Uncomment once the diagram image is uploaded: \includegraphics[width=0.6\linewidth]{HW6 images/credentials.png}
% \includegraphics[width=\linewidth]{HW6 images/ci-deployment.png} \caption{Jenkins global credential \texttt{gitea-jenkins-ci} (Gitea Personal Access Token). The token value is concealed and is not reproduced in this manual.}
\fbox{\parbox[c][3cm][c]{0.9\linewidth}{\centering\textit{[Diagram to be added]}}} \label{fig:ci-credential}
\caption{Adapted UML deployment diagram of the Gitea and Jenkins CI paths}
\label{fig:ci-deployment}
\end{figure} \end{figure}
\subsection{Repository and Integration Identity} \subsection{Repository and Integration Identity}
@@ -312,6 +340,65 @@ this integration and limited to what Jenkins needs:
\label{fig:ci-token} \label{fig:ci-token}
\end{figure} \end{figure}
\subsection{Webhook Configuration and Delivery}
The Jenkins Gitea integration is configured to communicate with the
Gitea server at \url{https://git.ssw590-08.me/}. The Gitea webhook
connects repository events to the Jenkins service. Jenkins is
reachable externally through Caddy over HTTPS, while the Jenkins
container itself is attached to the shared Docker network
\texttt{gitea-net}. The Caddy reverse proxy forwards requests for
\url{https://ci.ssw590-08.me/} to the Jenkins service on port 8080
inside the Docker network.
The webhook was created in Gitea (\emph{Scrap-Web $\rightarrow$ Settings
$\rightarrow$ Webhooks}) and points at the endpoint exposed by the Jenkins
Gitea plugin. Its details, as shown in
Figures~\ref{fig:ci-webhook-list} and~\ref{fig:ci-webhook-delivery}, are:
\begin{description}
\item[Name:] \texttt{Jenkins Webhook}
\item[Target URL:] \url{https://ci.ssw590-08.me/gitea-webhook/post}, reached
over HTTPS through Caddy
\item[Status:] Listed with a green (healthy) indicator in the repository's
webhook list
\item[Verification:] A \emph{Test Push Event} was sent from Gitea on
October 23, 2026. \emph{Recent Deliveries} lists delivery
\texttt{6b542d91-02b7-45be-a6c2-ba9989df7f4f} with a green check mark,
meaning Gitea delivered the event to the Jenkins endpoint successfully.
\item[Trigger events, content type, and secret:]
\textit{[The webhook triggers on all pushes to main, there's no direct content formed from this, and there is no secret set for the webhook]}
\end{description}
Figure~\ref{fig:ci-job-list} shows the Jenkins job list shortly after the test
delivery: the \texttt{Scrap-Web} Multibranch Pipeline reports a last success
25 seconds earlier, with a last duration of 10 seconds. The Multibranch
Pipeline is also configured to scan the repository periodically as a
fallback; the repository scan log and the matching Jenkins run should be
retained with the webhook delivery record to document the complete trigger
path.
\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{HW6 images/webhook-list.png}
\caption{\textit{10/23/26} --- Gitea webhook \texttt{Jenkins Webhook} for Scrap-Web, targeting \texttt{https://ci.ssw590-08.me/gitea-webhook/post}.}
\label{fig:ci-webhook-list}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{HW6 images/webhook-delivery.png}
\caption{\textit{10/23/26} --- Gitea \emph{Recent Deliveries} for the Jenkins webhook, showing a successful \emph{Test Push Event} delivery.}
\label{fig:ci-webhook-delivery}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=0.9\linewidth]{HW6 images/jenkins-job-list.png}
\caption{\textit{10/23/26} --- Jenkins job list showing the \texttt{Scrap-Web} Multibranch Pipeline, last success 25 seconds earlier, captured shortly after the test delivery.}
\label{fig:ci-job-list}
\end{figure}
\subsection{Job Configuration and Trigger} \subsection{Job Configuration and Trigger}
\label{sec:ci-trigger-config} \label{sec:ci-trigger-config}
@@ -373,25 +460,117 @@ were checked and skipped.
\label{fig:ci-scan-log} \label{fig:ci-scan-log}
\end{figure} \end{figure}
\subsection{Build and Commit Traceability}
The Jenkins job is configured as a Multibranch Pipeline using the
Gitea source integration. Jenkins discovers branches and pull
requests from the repository and associates builds with the relevant
revision. This makes it possible to trace a proposed change from its
Gitea pull request to the Jenkins build and its reported status.
During verification, Jenkins logs showed pull-request build activity
for pull request \#13. The logs also showed status notifications for
the following revisions:
\begin{itemize}
\item \texttt{1de58d4742d1ad600dacad50890c845ab963e985}
\item \texttt{84a44f0477dac51b540d038bf3a94b8f49bec275}
\end{itemize}
These revisions were associated with Jenkins status notifications.
The Jenkins log included messages indicating that a pending build
was being reported and that the notification completed. For the
final submission, the commit IDs should be cross-checked against the
corresponding Gitea commit or pull-request pages and the Jenkins
build details.
The traceability path is therefore:
\begin{enumerate}
\item A developer pushes a commit or creates or updates a pull
request in the Gitea repository.
\item Gitea delivers the configured webhook event to the Jenkins
integration.
\item The Jenkins Multibranch Pipeline discovers the relevant
branch or pull-request revision and starts the associated
build.
\item Jenkins records the build result and reports the associated
status back to Gitea.
\item A reviewer can inspect the pull request, commit, and Jenkins
result to determine whether the proposed change passed the
configured checks.
\end{enumerate}
\subsection{Deployment Diagram}
Figure~\ref{fig:gitea-jenkins-deployment} illustrates the deployment
and communication paths between the developer, Gitea, the webhook,
Jenkins, and the repository's build process. The HTTPS browser path
is shown separately from the webhook path to distinguish normal user
access from automated event delivery.
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{figures/gitea-jenkins-deployment.png}
\caption{Deployment and communication paths for Gitea and Jenkins
continuous integration.}
\label{fig:gitea-jenkins-deployment}
\end{figure}
\subsection{Job Configuration and Trigger}
\label{sec:ci-trigger-config}
The Multibranch Pipeline job uses the Jenkins Gitea plugin as its branch
source, pointed at owner \texttt{SSW-590-08} and repository
\texttt{Scrap-Web} through the \texttt{Scrap Gitea} server entry
(\url{https://git.ssw590-08.me}). Its relevant settings are:
\begin{tabularx}{\linewidth}{L{4.6cm}Y}
\toprule
\textbf{Setting} & \textbf{Value and reason}\\ \midrule
Discover branches & Enabled, so \texttt{main} and feature branches appear
in the job.\\
Discover pull requests from origin & Strategy: \emph{the current pull
request revision}. Jenkins tests the pull request's actual head commit, so
the tested commit ID matches the one shown in Gitea.\\
Discover pull requests from forks & Trust: \emph{Nobody}. Fork pull requests
are built with the trusted \texttt{Jenkinsfile} from \texttt{main}
(Section~\ref{sec:ci-credentials}).\\
Build configuration & By \texttt{Jenkinsfile}, script path
\texttt{Jenkinsfile}.\\
Scan repository trigger & Periodically if not otherwise run, every
1 minute.\\
\bottomrule
\end{tabularx}
\textbf{Trigger: webhook with polling fallback.} The Gitea webhook
(Section~\ref{sec:ci-trigger}) notifies Jenkins when a push or pull-request
event occurs, so a build can start without waiting for the next scan. As a
safety net, the job also scans Scrap-Web every minute and starts a build for
any branch or pull request whose head commit has changed. A missed or failed
webhook delivery therefore delays a build by about one minute instead of
losing it. In practice, each push in Section~\ref{sec:ci-failure} was built
within about two minutes.
\subsection{Traceability: Commit to Jenkins Run} \subsection{Traceability: Commit to Jenkins Run}
The table below traces one trigger from the commit in Gitea to the Jenkins The table below traces one trigger from the commit in Gitea to the Jenkins
run that tested it. The commit ID is the same in Gitea's commit list, in the run that tested it. The commit ID is the same in Gitea's commit list, in the
run's Checkout log (\texttt{git rev-parse HEAD}), and on the status Gitea run's Checkout log (\texttt{git rev-parse HEAD}), and on the status Gitea
displays for that commit (Figure~\ref{fig:ci-pr-fail-fix}). displays for that commit.
\begin{tabularx}{\linewidth}{L{4.2cm}Y} \begin{tabularx}{\linewidth}{L{4.2cm}Y}
\toprule \toprule
\textbf{Item} & \textbf{Value}\\ \midrule \textbf{Item} & \textbf{Value}\\ \midrule
Event & Repair commit pushed to branch \texttt{feature/issue-11}, the source Event & Repair commit pushed to branch \texttt{feature/issue-11}, the source
of pull request \#13\\ of pull request \#13\\
Time & October 23, 2026; Jenkins run started at 11:07 PM\\ Time pushed & October 23, 2026, 11:07 PM\\
Detected by & Repository scan (polling); build started automatically\\ Detected by & Repository scan (polling); build started automatically\\
Pull request & \#13, Pull request & \#13,
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}\\ \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}\\
Triggering commit & \texttt{84a44f0477}\\ Triggering commit & \texttt{84a44f0}\\
Jenkins run & \texttt{Scrap-Web/PR-13} run \#9 (Figure~\ref{fig:ci-runs}; Jenkins run & \texttt{Scrap-Web/PR-13} run \#9 (the job was later
the job was later removed by Jenkins, see below)\\ removed by Jenkins; see below)\\
Status posted to Gitea & \texttt{Scrap-Web/pipeline/pr-main}: success, Status posted to Gitea & \texttt{Scrap-Web/pipeline/pr-main}: success,
visible on the commit in visible on the commit in
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{pull \href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{pull
@@ -399,17 +578,24 @@ Status posted to Gitea & \texttt{Scrap-Web/pipeline/pr-main}: success,
\bottomrule \bottomrule
\end{tabularx} \end{tabularx}
\begin{figure}[H]
\centering
\includegraphics[width=0.6\linewidth]{HW6 images/pass.png}
\caption{\textit{10/23/26} --- Jenkins stage history for \texttt{Scrap-Web/PR-13}, runs \#1--\#9. Run \#1 failed in the Checkout stage; run \#9 (23:07) passed.}
\label{fig:ci-pr13-history}
\end{figure}
\subsection{Where Checkout and Tests Run} \subsection{Where Checkout and Tests Run}
Checkout, the syntax check, and the tests all run on the Jenkins Checkout, the syntax check, and the tests all run on the Jenkins
controller's built-in node, inside the Jenkins container; the stage view of controller's built-in node, inside the Jenkins container; the stage view of
each run lists the node as \emph{Jenkins} (the built-in node, each run lists the node as \emph{Jenkins (built-in)}. There is no separate
Figure~\ref{fig:ci-stage-view}). There is no separate build agent and no inbound build agent and no inbound agent port. Jenkins clones the commit from Gitea
agent port. Jenkins clones the commit from Gitea over HTTPS into its over HTTPS into its workspace under \texttt{/var/jenkins\_home/workspace/}
workspace under \texttt{/var/jenkins\_home/workspace/} and runs the and runs the \texttt{Jenkinsfile} stages there
\texttt{Jenkinsfile} stages there (Section~\ref{sec:ci-pipeline}). The risk (Section~\ref{sec:ci-pipeline}). The risk of building on the controller and
of building on the controller and the restrictions that limit it are covered the restrictions that limit it are covered in
in Section~\ref{sec:ci-credentials}. Section~\ref{sec:ci-credentials}.
\subsection{Failure Diagnoses} \subsection{Failure Diagnoses}
@@ -417,35 +603,37 @@ Four integration problems were diagnosed and corrected.
\textbf{Repository not visible to Jenkins.} When the job was first \textbf{Repository not visible to Jenkins.} When the job was first
configured, the Repository list for owner \texttt{SSW-590-08} was empty, configured, the Repository list for owner \texttt{SSW-590-08} was empty,
even though the token had repository access. \textit{[Cause and fix.]} even though the token had repository access. Listing an organization's repositories requires the
After the correction the repository appeared and the first scan discovered \texttt{read:organization} scope, which the first token lacked. A new token
pull request \#13 (Figure~\ref{fig:ci-scan-log}). with that scope was generated, the Jenkins credential was updated, and the
old tokens were deleted. After the correction the repository appeared and
the first scan discovered pull request \#13.
\textbf{First build failed: \texttt{python3: not found}.} Run \#1 of \textbf{First build failed: \texttt{python3: not found}.} Run \#1 of
\texttt{PR-13} (October 23, 2026, 00:13) checked out the commit \texttt{PR-13} (October 23, 2026) checked out the commit successfully,
successfully, proving the integration worked, but failed in the Checkout proving the integration worked, but failed in the Checkout stage at
stage at \texttt{python3 --version} with exit code 127; the later stages were \texttt{python3 --version} with exit code 127. The official Jenkins image
skipped (Figure~\ref{fig:ci-runs}). The official Jenkins image does not does not include Python. The fix was a deployment change, not a code change:
include Python. The fix was a deployment change, not a code change: the Jenkins container is now built from \texttt{jenkins/Dockerfile}, which
\texttt{python3} was added to the Jenkins container \textit{[confirm how: adds \texttt{python3} to the recorded Jenkins LTS image. Run \#2 on the same
e.g.\ by building it from \texttt{jenkins/Dockerfile}]}. Run \#2, started pull request then passed, reporting Python 3.13.5.
manually on the same commit at 9:39 PM, then passed and reported Python
3.13.5 (Figure~\ref{fig:ci-stage-view}).
\textbf{Required check reported as missing.} After the status-check \textbf{Required check reported as missing.} After the status-check
requirement was added, Gitea showed the Jenkins check as green but still requirement was added, Gitea showed the Jenkins check as green but still
reported ``some required checks are missing'' and blocked the merge. reported ``some required checks are missing'' and blocked the merge.
\textit{[Cause and fix.]} The branch rule contained a pattern that did
not exactly match the reported context \texttt{Scrap-Web/pipeline/pr-main}.
It was corrected to that exact name.
\textbf{Pull request runs deleted after merge.} Shortly after pull request \textbf{Pull request runs deleted after merge.} Shortly after pull request
\#13 was merged, the \texttt{PR-13} job and all of its runs disappeared from \#13 was merged, the \texttt{PR-13} job and all of its runs disappeared from
Jenkins. The pull request was closed, and the Multibranch job's default Jenkins. The Scan Repository Log showed that the job had been removed as an
orphaned item strategy discards the jobs of closed pull requests. Deleted orphaned item: the pull request was closed, and the Multibranch job's default
runs cannot be restored without a backup of \texttt{jenkins\_home}. The orphaned item strategy discards such jobs immediately. Deleted runs cannot be
evidence survives in Gitea, because the commit statuses Jenkins posted remain restored without a backup of \texttt{jenkins\_home}. The evidence survives in
attached to each commit of pull request \#13, and in the screenshots captured Gitea, because the commit statuses Jenkins posted remain attached to each
while the runs existed. To keep future evidence, the job's \emph{Orphaned commit of pull request \#13. To keep future evidence, the job's
Item Strategy} was changed to keep old items for 30 days. \emph{Orphaned Item Strategy} was changed to keep old items for 30 days.
If a trigger fails in future, the operator follows the procedure in If a trigger fails in future, the operator follows the procedure in
Section~\ref{sec:ci-troubleshoot}. Section~\ref{sec:ci-troubleshoot}.
+1 -1
View File
@@ -7,7 +7,7 @@
\begin{tabularx}{\linewidth}{L{3.1cm}L{2.2cm}YL{2.0cm}} \begin{tabularx}{\linewidth}{L{3.1cm}L{2.2cm}YL{2.0cm}}
\toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule \toprule \textbf{Date / Version} & \textbf{Author Initials} & \textbf{Change} & \textbf{Changed At}\\ \midrule
October 22, 2026 / 1.5 & SK, KH & Completed the Continuous Integration with Jenkins assignment: deployed a persistent Jenkins LTS container behind HTTPS at \texttt{ci.ssw590-08.me} with firewall-restricted access; integrated Jenkins with the Scrap-Web Gitea repository through a dedicated integration account; added a pricing module, unit tests, and a versioned \texttt{Jenkinsfile}; protected \texttt{main} with a required Jenkins status check and one required approval; and demonstrated a failed, repaired, reviewed, and merged pull request. Updated the Hosts table (Jenkins host and ports) and the Passwords table (Jenkins administrator accounts and the Gitea integration token, hints only). & \ChapterRef{ContinuousIntegration}, \ChapterRef{PWDHST} \\ October 23, 2026 / 1.5 & SK, KH & Completed the Continuous Integration with Jenkins assignment: deployed a persistent Jenkins LTS container behind HTTPS at \texttt{ci.ssw590-08.me} with firewall-restricted access; integrated Jenkins with the Scrap-Web Gitea repository through a dedicated integration account; added a pricing module, unit tests, and a versioned \texttt{Jenkinsfile}; protected \texttt{main} with a required Jenkins status check and one required approval; and demonstrated a failed, repaired, reviewed, and merged pull request. Updated the Hosts table (Jenkins host and ports) and the Passwords table (Jenkins administrator accounts and the Gitea integration token, hints only). & \ChapterRef{ContinuousIntegration}, \ChapterRef{PWDHST} \\
October 10, 2026 / 1.4 & SK, KH & Completed the related Gitea automation in LaTeX exercise and documented it in new chapter & \ChapterRef{AutomatedManualBuild} \\ October 10, 2026 / 1.4 & SK, KH & Completed the related Gitea automation in LaTeX exercise and documented it in new chapter & \ChapterRef{AutomatedManualBuild} \\
-5
View File
@@ -1,5 +0,0 @@
# Pinned image versions only. No passwords in this file.
PROMETHEUS_TAG=v3.13.5
GRAFANA_TAG=13.2.5
NODE_EXPORTER_TAG=v1.12.1
BLACKBOX_TAG=v0.29.0
-2
View File
@@ -1,2 +0,0 @@
# Secrets stay on the Droplet only
grafana.secrets.env
-65
View File
@@ -1,65 +0,0 @@
# SSW 590 Monitoring Runbook
Dashboard: https://metrics.ssw590-08.me/d/ssw590-sre
Contact point: `team-alerts` (email). Times are America/New_York.
---
## ServiceUnavailable – Gitea or Jenkins HTTPS probe failing
**Owner:** samahk13 (primary), kholmes (backup)
**Severity:** critical
**Fires when:** `probe_success{job="https"}` is 0 for an instance for at least 1 minute,
or the probe series is missing (no data) / the query errors.
### 1. Acknowledge
Reply to the alert email (or post in the team chat) with "ack" and your name, and
note the time. This is the acknowledgement time in the incident timeline.
### 2. Is it the service or the monitoring?
- Open the dashboard. Check the **Scrape health (up)** row.
- `blackbox` or `https` shows DOWN / no data → the **monitoring** is broken,
not necessarily the service. Go to step 5.
- `up` is 1 but panel 4 or 5 shows DOWN → the probed request failed. Continue.
- Open the URL in a browser:
- Gitea: https://git.ssw590-08.me/user/login
- Jenkins: https://ci.ssw590-08.me/login
### 3. Check the container (SSH to the Droplet as root)
```
docker ps -a --format 'table {{.Names}}\t{{.Status}}'
docker logs --tail=50 jenkins # or: gitea
docker logs --tail=50 caddy # proxy / TLS problems
```
### 4. Restore
- Container stopped/exited:
```
docker start jenkins # or: docker start gitea
```
- Container running but unhealthy: `docker restart jenkins`
- Certificate/proxy error: check `docker logs caddy`; validate with
`docker exec caddy caddy validate --config /etc/caddy/Caddyfile`.
- **Never** use `docker compose down -v` (deletes data volumes).
Wait for the next probes (~30–60 s). The alert resolves when `probe_success` is 1
again; confirm the "Resolved" email arrives.
### 5. Monitoring itself is failing (no data / error)
```
cd /root/Scrap-Web/monitoring
docker compose ps
docker compose logs --tail=50 prometheus blackbox-exporter
docker compose start prometheus blackbox-exporter
```
### 6. After recovery
- Jenkins: run **Build Now** on `main` and confirm it passes.
- Gitea: confirm the web login and that Jenkins can still post commit statuses.
- Record the timeline in the incident issue.
---
## HostDiskLow – root filesystem below 15 % free
**Owner:** kholmes — *(partner to complete)*
-12
View File
@@ -1,12 +0,0 @@
#!/bin/sh
# Step 1 baseline - run on the Droplet BEFORE starting the monitoring stack.
# Output contains no secrets; paste it into the Gitea issue.
echo "== date"; date -Is
echo "== OS"; cat /etc/os-release | head -4; uname -r
echo "== CPU"; nproc; grep -m1 "model name" /proc/cpuinfo; uname -m
echo "== memory (bytes)"; free -b
echo "== root disk"; df -B1 /; df -h /
echo "== docker"; docker version --format '{{.Server.Version}}'; docker compose version
echo "== containers"; docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
echo "== container usage"; docker stats --no-stream --format 'table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}'
echo "== load"; uptime
-12
View File
@@ -1,12 +0,0 @@
modules:
http_2xx:
prober: http
timeout: 10s
http:
method: GET
preferred_ip_protocol: ip4
valid_status_codes: [] # empty = any 2xx is success
follow_redirects: true
fail_if_not_ssl: true
tls_config:
insecure_skip_verify: false
-67
View File
@@ -1,67 +0,0 @@
# SSW 590 - Monitoring stack (Prometheus, Grafana OSS, Node Exporter, Blackbox Exporter)
# Only Grafana joins gitea-net so the existing Caddy container can proxy it.
# No host ports are published; Prometheus and the exporters stay on the private network.
services:
prometheus:
image: prom/prometheus:${PROMETHEUS_TAG:?choose a release}
container_name: prometheus
restart: unless-stopped
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=7d
- --storage.tsdb.retention.size=5GB
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks: [monitoring]
grafana:
image: grafana/grafana:${GRAFANA_TAG:?choose a release}
container_name: grafana
restart: unless-stopped
depends_on: [prometheus]
env_file: [grafana.secrets.env]
environment:
GF_SERVER_ROOT_URL: "https://metrics.ssw590-08.me/"
GF_SERVER_DOMAIN: "metrics.ssw590-08.me"
GF_AUTH_ANONYMOUS_ENABLED: "false"
GF_USERS_ALLOW_SIGN_UP: "false"
GF_DATE_FORMATS_DEFAULT_TIMEZONE: "America/New_York"
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- ./grafana/dashboards:/var/lib/grafana/dashboards:ro
networks: [monitoring, gitea-net]
node-exporter:
image: quay.io/prometheus/node-exporter:${NODE_EXPORTER_TAG:?choose a release}
container_name: node-exporter
restart: unless-stopped
pid: host
command:
- --path.rootfs=/host
- --path.procfs=/host/proc
- --path.sysfs=/host/sys
volumes:
- /:/host:ro,rslave
networks: [monitoring]
blackbox-exporter:
image: quay.io/prometheus/blackbox-exporter:${BLACKBOX_TAG:?choose a release}
container_name: blackbox-exporter
restart: unless-stopped
command: ["--config.file=/config/blackbox.yml"]
volumes:
- ./blackbox/blackbox.yml:/config/blackbox.yml:ro
networks: [monitoring]
networks:
monitoring:
gitea-net:
external: true
name: gitea-net
volumes:
prometheus_data:
grafana_data:
-2
View File
@@ -1,2 +0,0 @@
# Copy to grafana.secrets.env on the Droplet and fill in. Never commit the real file.
GF_SECURITY_ADMIN_PASSWORD=CHANGE_ME
@@ -1,64 +0,0 @@
apiVersion: 1
groups:
- orgId: 1
name: availability
folder: SSW 590
interval: 30s
rules:
- uid: fg2n29o6c9a80d
title: ServiceUnavailable
condition: C
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: prometheus
model:
editorMode: code
expr: probe_success{job="https"}
instant: true
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: false
refId: A
- refId: C
queryType: expression
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 1
type: lt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
noDataState: Alerting
execErrState: Alerting
for: 1m
annotations:
runbook_url: https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/monitoring/RUNBOOK.md
summary: '{{ $labels.instance }} HTTPS probe failing for 1m'
labels:
owner: samahk13
severity: critical
team: ssw590
isPaused: false
notification_settings:
receiver: team-alerts
@@ -1,547 +0,0 @@
{
"uid": "ssw590-sre",
"title": "SSW 590 \u2013 Gitea & Jenkins Reliability",
"tags": [
"ssw590",
"sre"
],
"timezone": "America/New_York",
"time": {
"from": "now-6h",
"to": "now"
},
"refresh": "30s",
"schemaVersion": 39,
"version": 1,
"editable": true,
"graphTooltip": 1,
"panels": [
{
"id": 1,
"type": "timeseries",
"title": "1. Droplet CPU utilization (all CPUs)",
"description": "Percent of CPU time not idle, averaged across all CPUs over a 2-minute rate window. Whole-droplet: includes Gitea, Jenkins, Caddy and monitoring; does not attribute CPU to a container.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "100 * (1 - avg(rate(node_cpu_seconds_total{job=\"node\",mode=\"idle\"}[2m])))",
"legendFormat": "CPU busy %",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "orange",
"value": 70
},
{
"color": "red",
"value": 90
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "line"
},
"lineWidth": 2,
"fillOpacity": 10
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 2,
"type": "timeseries",
"title": "2. Available host memory",
"description": "MemAvailable: the kernel's estimate of memory available to start new applications without swapping (bytes, IEC). Not the same as unused RAM.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "node_memory_MemAvailable_bytes{job=\"node\"}",
"legendFormat": "MemAvailable",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes",
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "orange",
"value": 209715200
},
{
"color": "green",
"value": 419430400
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "line"
},
"lineWidth": 2,
"fillOpacity": 10
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 3,
"type": "timeseries",
"title": "3. Root filesystem available space (/dev/vda1)",
"description": "Available bytes divided by size bytes for the host root filesystem only (device /dev/vda1, mounted at /). Alert threshold is 15%.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "100 * node_filesystem_avail_bytes{job=\"node\",mountpoint=\"/\",device=\"/dev/vda1\"} / node_filesystem_size_bytes{job=\"node\",mountpoint=\"/\",device=\"/dev/vda1\"}",
"legendFormat": "root available %",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "percent",
"min": 0,
"max": 100,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "orange",
"value": 15
},
{
"color": "green",
"value": 25
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "line"
},
"lineWidth": 2,
"fillOpacity": 10
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 4,
"type": "timeseries",
"title": "6. HTTPS probe duration",
"description": "Total time for each Blackbox HTTPS probe (DNS + connect + TLS + request, following redirects), one line per service.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "probe_duration_seconds{job=\"https\"}",
"legendFormat": "{{instance}}",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "s",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "off"
},
"lineWidth": 2,
"fillOpacity": 10
}
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 5,
"type": "timeseries",
"title": "4. Gitea HTTPS availability",
"description": "1 = Blackbox Exporter's HTTPS probe of https://git.ssw590-08.me/user/login succeeded (DNS, valid TLS, 2xx after redirects); 0 = failed. Sampled every 30 s.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 7
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "probe_success{job=\"https\",instance=\"https://git.ssw590-08.me/user/login\"}",
"legendFormat": "{{instance}}",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "none",
"min": 0,
"max": 1,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "line"
},
"lineWidth": 2,
"fillOpacity": 10,
"drawStyle": "line",
"lineInterpolation": "stepAfter"
},
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "DOWN",
"color": "red"
},
"1": {
"text": "UP",
"color": "green"
}
}
}
],
"decimals": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 6,
"type": "timeseries",
"title": "5. Jenkins HTTPS availability",
"description": "1 = Blackbox Exporter's HTTPS probe of https://ci.ssw590-08.me/login succeeded (DNS, valid TLS, 2xx after redirects); 0 = failed. Sampled every 30 s.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 7
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "probe_success{job=\"https\",instance=\"https://ci.ssw590-08.me/login\"}",
"legendFormat": "{{instance}}",
"range": true
}
],
"fieldConfig": {
"defaults": {
"unit": "none",
"min": 0,
"max": 1,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"custom": {
"thresholdsStyle": {
"mode": "line"
},
"lineWidth": 2,
"fillOpacity": 10,
"drawStyle": "line",
"lineInterpolation": "stepAfter"
},
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "DOWN",
"color": "red"
},
"1": {
"text": "UP",
"color": "green"
}
}
}
],
"decimals": 0
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "multi"
}
}
},
{
"id": 7,
"type": "stat",
"title": "Scrape health (up)",
"description": "1 = Prometheus scraped the target successfully. A target can be up while its probe_success is 0.",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 23,
"w": 24,
"h": 5
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"expr": "up",
"legendFormat": "{{job}} {{instance}}",
"instant": true
}
],
"fieldConfig": {
"defaults": {
"mappings": [
{
"type": "value",
"options": {
"0": {
"text": "DOWN",
"color": "red"
},
"1": {
"text": "UP",
"color": "green"
}
}
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "red",
"value": null
},
{
"color": "green",
"value": 1
}
]
},
"unit": "none"
},
"overrides": []
},
"options": {
"colorMode": "background",
"graphMode": "none",
"textMode": "value_and_name",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
}
}
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
}
}
@@ -1,8 +0,0 @@
apiVersion: 1
providers:
- name: ssw590
folder: SSW 590
type: file
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
@@ -1,9 +0,0 @@
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
-32
View File
@@ -1,32 +0,0 @@
global:
scrape_interval: 30s
evaluation_interval: 30s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["prometheus:9090"]
- job_name: node
static_configs:
- targets: ["node-exporter:9100"]
- job_name: blackbox
static_configs:
- targets: ["blackbox-exporter:9115"]
- job_name: https
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- https://git.ssw590-08.me/user/login
- https://ci.ssw590-08.me/login
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115