40 Commits

Author SHA1 Message Date
samahk13 2ab41bdce5 Update ServiceUnavailable alert export and runbook for #18
Scrap-Web/pipeline/pr-main This commit looks good
Scrap-Web/pipeline/head This commit looks good
2026-10-29 17:24:21 -04:00
samahk13 01f842323e Fix ServiceUnavailable threshold for #18
Scrap-Web/pipeline/head This commit looks good
2026-10-28 20:39:33 -04:00
samahk13 d6ea94f20d Add ServiceUnavailable alert export and runbook for #18
Scrap-Web/pipeline/head This commit looks good
2026-10-28 20:32:10 -04:00
samahk13 6d65f29674 Add SRE dashboard definition for #18
Scrap-Web/pipeline/head This commit looks good
2026-10-28 17:42:15 -04:00
samahk13 4c098708f4 Add monitoring stack config for #18
Scrap-Web/pipeline/head This commit looks good
2026-10-28 15:02:43 -04:00
kholmes 3301e2463e Merge pull request 'compose file addition' (#17) from kholmes-patch-3 into main
Scrap-Web/pipeline/head This commit looks good
Reviewed-on: #17
2026-10-24 08:01:55 +00:00
kholmes ae289072ed compose file addition
Scrap-Web/pipeline/pr-main Build queued...
Scrap-Web/pipeline/head This commit looks good
2026-10-24 08:01:30 +00:00
samahk13 696b328a7d Merge pull request 'Add CI with Jenkins chapter, screenshots, glossary, references, version 1.5 (#11)' (#16) from docs/ci-chapter into main
Scrap-Web/pipeline/head This commit looks good
Build IT manual / build-manual (push) Failing after 2m21s
Reviewed-on: #16
Reviewed-by: kholmes <kholmes2@stevens.edu>
2026-10-24 04:32:08 +00:00
samahk13 38d2e1e965 Add CI with Jenkins chapter, screenshots, glossary, references, version 1.5 (#11)
Scrap-Web/pipeline/pr-main This commit looks good
Scrap-Web/pipeline/head This commit looks good
2026-10-24 00:28:24 -04:00
samahk13 1de58d4742 Merge pull request 'Add pricing module, tests and Jenkinsfile for CI (#11)' (#13) from feature/issue-11 into main
Scrap-Web/pipeline/head This commit looks good
Reviewed-on: #13
Reviewed-by: kholmes <kholmes2@stevens.edu>
2026-10-24 03:13:17 +00:00
samahk13 84a44f0477 Fix total_price: restore multiplication (#11)
Scrap-Web/pipeline/pr-main This commit looks good
Scrap-Web/pipeline/head This commit looks good
2026-10-23 23:06:39 -04:00
samahk13 a5180ad781 Demonstrate failing CI check: use addition in total_price (#N)
Scrap-Web/pipeline/pr-main There was a failure building this commit
2026-10-23 23:04:14 -04:00
samahk13 8ba340e32f Remove stray files from CI pull request; manual chapter moves to its own PR (#11)
Scrap-Web/pipeline/pr-main This commit looks good
2026-10-23 23:01:57 -04:00
samahk13 c5538a84d1 Merge main into feature/issue-11, keeping the tested Jenkinsfile (#11)
Scrap-Web/pipeline/pr-main This commit looks good
2026-10-23 22:52:52 -04:00
samahk13 81c343ddb6 Fix total_price: restore multiplication (#11)
Scrap-Web/pipeline/pr-main This commit looks good
2026-10-23 22:41:45 -04:00
samahk13 091a9a9695 Update repository with local changes 2026-10-23 22:36:04 -04:00
samahk13 ab0bcc25f3 Demonstrate failing CI check: use addition in total_price (#11)
Scrap-Web/pipeline/pr-main There was a failure building this commit
2026-10-23 22:32:31 -04:00
kholmes fa22a0d512 Merge pull request 'Added Jenkinsfile for build automation' (#15) from kholmes-patch-2 into main
Scrap-Web/pipeline/head There was a failure building this commit
Reviewed-on: #15
2026-10-24 01:19:22 +00:00
kholmes b779817f2c Added Jenkinsfile for build automation
Scrap-Web/pipeline/pr-main There was a failure building this commit
Scrap-Web/pipeline/head There was a failure building this commit
2026-10-24 01:18:17 +00:00
samahk13 b899233138 Add pricing module, tests and Jenkinsfile for CI (#11)
Scrap-Web/pipeline/pr-main This commit looks good
2026-10-18 15:03:41 -04:00
kholmes 7ffe1f0b34 Updated devopsAIAgentGuide
Build IT manual / build-manual (push) Successful in 25s
2026-10-11 01:54:14 +00:00
kholmes 75c2f21bae Added comments to devopsAssignment
Build IT manual / build-manual (push) Successful in 29s
2026-10-11 01:51:26 +00:00
kholmes 8174773cfb Updated README 2026-10-11 01:49:40 +00:00
kholmes 898660fd30 Repaired Build
Build IT manual / build-manual (push) Successful in 27s
2026-10-11 00:57:25 +00:00
kholmes b76eba3c4f Purposeful Error
Build IT manual / build-manual (push) Failing after 13s
2026-10-11 00:54:22 +00:00
kholmes 67e9e17eab added metadata grab
Build IT manual / build-manual (push) Successful in 28s
2026-10-10 20:55:49 +00:00
kholmes 543be42786 added for H5 step 4
Build IT manual / build-manual (push) Successful in 28s
2026-10-10 20:54:02 +00:00
kholmes 05ef5690b1 updated versioning
Build IT manual / build-manual (push) Successful in 33s
2026-10-10 20:42:47 +00:00
kholmes 1b0d53291f changed upload artifact version
Build IT manual / build-manual (push) Successful in 40s
2026-10-10 04:31:48 +00:00
kholmes f95aa89208 Update manual/ci/Dockerfile
Build IT manual / build-manual (push) Failing after 28s
2026-10-10 03:55:42 +00:00
kholmes c61c4d9d86 Update manual/ci/Dockerfile
Build IT manual / build-manual (push) Failing after 15s
2026-10-10 03:27:09 +00:00
kholmes bd6dc0a865 Update manual/ci/Dockerfile
Build IT manual / build-manual (push) Failing after 13s
2026-10-10 03:00:49 +00:00
kholmes a7b93e380a updated dockerfile again
Build IT manual / build-manual (push) Failing after 12s
2026-10-10 02:57:31 +00:00
kholmes ebd8b2e424 updated Dockerfile 2026-10-10 02:40:55 +00:00
samahk13 5e0b7e595d Merge pull request 'Issue 8' (#9) from issue-8 into main
Build IT manual / build-manual (push) Failing after 36s
Reviewed-on: #9
2026-10-09 19:03:54 +00:00
samahk13 46cb1aac07 Add Gitea Actions workflow and LaTeX job image for the IT manual (#6) 2026-10-08 23:50:26 -04:00
samahk13 45dfb9b7ed Add DevOps IT manual LaTeX source 2026-10-08 23:47:08 -04:00
samahk13 c6decd1f08 Merge pull request '#1' (#4) from issue-1 into main
Reviewed-on: #4
2026-10-03 03:45:22 +00:00
samahk13 cc290d65ff Merge pull request '#5' (#7) from issue-5 into main
Reviewed-on: #7
2026-10-03 03:31:04 +00:00
samahk13 6f76e53e5d Quickly updated README.md 2026-10-02 23:27:57 -04:00
77 changed files with 6990 additions and 1 deletions
+83
View File
@@ -0,0 +1,83 @@
# Builds the DevOps IT manual (manual/) into a PDF on every push to main
# that touches the manual or this workflow, and uploads it as an artifact.
name: Build IT manual
on:
push:
branches: [main]
paths:
- "manual/**"
- ".gitea/workflows/manual.yml"
workflow_dispatch: # lets a team member re-run a build by hand from the Actions tab
jobs:
build-manual:
# Runner label registered in Part 2. The label maps to the job image built
# from manual/ci/Dockerfile (TeX Live + Node.js), so each job runs in a
# fresh, temporary container -- never inside the Gitea container.
runs-on: latex
defaults:
run:
shell: bash
steps:
- name: Check out the triggering commit
uses: actions/checkout@v4
- name: Generate build metadata
working-directory: manual
env:
GIT_COMMIT: ${{ github.sha }}
BUILD_NUMBER: ${{ github.run_number }}
run: |
MANUAL_VERSION="v1.5"
SHORT_SHA="${GIT_COMMIT:0:7}"
BUILD_ID="${MANUAL_VERSION}+build.${BUILD_NUMBER}.${SHORT_SHA}"
cat > build-metadata.tex <<EOF
\newcommand{\ManualVersion}{${MANUAL_VERSION}}
\newcommand{\BuildIdentifier}{${BUILD_ID}}
\newcommand{\BuildCommit}{${GIT_COMMIT}}
\newcommand{\BuildRunNumber}{${BUILD_NUMBER}}
EOF
cat >> build-metadata.tex <<'EOF'
\noindent\textbf{Manual version:} \ManualVersion\\
\textbf{Build identifier:} \BuildIdentifier\\
\textbf{Commit hash:} \BuildCommit\\
\textbf{Gitea Actions run:} \BuildRunNumber
EOF
- name: Record build identity and toolchain
run: |
SHORT_SHA="${GITHUB_SHA::7}"
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
echo "Commit: ${GITHUB_SHA} (${SHORT_SHA})"
echo "Run number: ${GITHUB_RUN_NUMBER}"
pdflatex --version | head -n 1
latexmk -v | head -n 2 | tail -n 1
python3 -c "import pygments; print('Pygments', pygments.__version__)"
- name: Compile the manual
working-directory: manual
# All options live in manual/.latexmkrc; it stops with a non-zero
# exit code on the first LaTeX error, which fails this step.
run: latexmk devopsAssignment.tex
- name: Verify the PDF exists
working-directory: manual
run: |
if [ ! -s devopsAssignment.pdf ]; then
echo "ERROR: manual/devopsAssignment.pdf is missing or empty"
exit 1
fi
ls -l devopsAssignment.pdf
- name: Upload the PDF as an artifact
uses: actions/upload-artifact@v3
with:
name: it-manual-build-${{ github.run_number }}-${{ env.SHORT_SHA }}
path: manual/devopsAssignment.pdf
if-no-files-found: error
retention-days: 30
+1
View File
@@ -0,0 +1 @@
__pycache__/
Vendored
+40
View File
@@ -0,0 +1,40 @@
// CI pipeline for Scrap-Web (SSW 590, Continuous Integration with Jenkins).
// Runs for every pull request through the Multibranch Pipeline job and reports
// its result to Gitea as a commit status. Uses only the Python 3 standard
// library, so no packages are downloaded during the build.
pipeline {
// Builds run on the Jenkins controller executor (see the IT manual for the
// documented risk). python3 must be installed in the Jenkins container.
agent any
options {
skipDefaultCheckout()
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('Checkout') {
steps {
checkout scm
// Record exactly which commit is being tested, for traceability.
sh 'git rev-parse HEAD'
sh 'python3 --version'
}
}
stage('Syntax check') {
steps {
sh 'python3 -m py_compile pricing.py tests/test_pricing.py'
}
}
stage('Test') {
steps {
sh 'python3 -m unittest discover -s tests -v'
}
}
}
post {
success { echo 'All checks passed.' }
failure { echo 'A stage failed: see the stage view for which one.' }
}
}
+5 -1
View File
@@ -1,3 +1,7 @@
# Scrap-Web
This Repo is here to act as Group 8's repo for the SSW590 course
This Repo is here to act as Group 8's repo for the SSW590 course
In the 10/2 assignment, we added a domain, reverse proxy, https, and created our repo in Gitea
In the 10/10 assignment, we added an automation workflow for compiling a LaTeX artifact upon git pushes
+21
View File
@@ -0,0 +1,21 @@
services:
jenkins:
build: .
image: custom-jenkins:lts-jdk21-python3
container_name: jenkins
restart: unless-stopped
environment:
JAVA_OPTS: "-Xms256m -Xmx512m"
volumes:
- jenkins-home:/var/jenkins_home
networks:
- gitea-net
volumes:
jenkins-home:
name: jenkins_home
networks:
gitea-net:
external: true
name: gitea-net
+29
View File
@@ -0,0 +1,29 @@
# LaTeX build output: generated by every compile, never committed.
# The PDF is produced by the Gitea Actions workflow and downloaded as an artifact.
*.pdf
*.aux
*.log
*.out
*.toc
*.lof
*.lot
*.bbl
*.blg
*.idx
*.ilg
*.ind
*.glo
*.gls
*.glg
*.acn
*.acr
*.alg
*.ist
*.fls
*.fdb_latexmk
*.synctex.gz
_minted*/
# Exception: PDFs used as figures inside the manual must stay tracked.
# Uncomment and adjust if you ever include a PDF image:
# !images/**/*.pdf
+21
View File
@@ -0,0 +1,21 @@
# Build configuration for the SSW 590 DevOps IT manual.
# Usage (from the repository root): latexmk devopsAssignment.tex
# Produce a PDF with pdflatex.
$pdf_mode = 1;
# -shell-escape : required by the minted package (calls Python Pygments)
# -interaction=nonstopmode, -halt-on-error : stop on the first LaTeX error
# instead of waiting for input, so CI fails clearly
# -file-line-error : print errors as file:line:message
$pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode -halt-on-error -file-line-error %O %S';
# Run makeglossaries when the glossary or acronym inputs change.
# (bibtex and makeindex are handled by latexmk automatically.)
add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
sub run_makeglossaries {
return system("makeglossaries \"$_[0]\"");
}
push @generated_exts, 'glo', 'gls', 'glg', 'acn', 'acr', 'alg', 'ist';
Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+2365
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
# Scrap-Web
This Repo is here to act as Group 8's repo for the SSW590 course
In the 10/2 assignment, we added a domain, reverse proxy, https, and created our repo in Gitea
+5
View File
@@ -0,0 +1,5 @@
This assignment guides students through a reproducible DevOps activity. It
defines the learning objectives, environment boundary, workflow, evidence,
reflection, and submission criteria. Replace bracketed text with assignment-
specific facts before release. Students should be able to recreate the work
from the submitted automation and runbook rather than from undocumented manual steps.
+31
View File
@@ -0,0 +1,31 @@
# Job image for the "latex" Gitea runner label (see .gitea/workflows/manual.yml).
#
# Base: official TeX Live image. It already includes Python + Pygments, which
# the minted package needs. A fixed release tag is used instead of "latest" so
# builds are reproducible; record the resolved digest in the manual.
FROM texlive/texlive:TL2025-historic
# The workflow's actions (checkout, upload-artifact) are JavaScript actions and
# need Node.js inside the job container; git lets checkout do a real clone.
# Packages come from the image's own Debian repositories -- no downloaded scripts.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
nodejs git ca-certificates python3 python3-pip python3-venv curl \
&& python3 -m venv /opt/latex-venv \
&& /opt/latex-venv/bin/pip install --upgrade pip \
&& /opt/latex-venv/bin/pip install --upgrade latexminted==0.7.1 Pygments \
&& mkdir -p /tmp/minted-src /usr/local/share/texmf/tex/latex/minted \
&& curl -fsSL https://mirrors.ctan.org/macros/latex/contrib/minted/minted.dtx \
-o /tmp/minted-src/minted.dtx \
&& curl -fsSL https://mirrors.ctan.org/macros/latex/contrib/minted/minted.ins \
-o /tmp/minted-src/minted.ins \
&& cd /tmp/minted-src \
&& latex minted.ins \
&& cp minted.sty /usr/local/texlive/2025/texmf-dist/tex/latex/minted/minted.sty \
&& mktexlsr \
&& rm -rf /tmp/minted-src \
&& mktexlsr \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="/opt/latex-venv/bin:/usr/local/bin:${PATH}"
+367
View File
@@ -0,0 +1,367 @@
%%
%% This is file `cornell.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% cornell.dtx (with options: `class')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from cornell.cls.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file cornell.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% Document class `cornell' to use with LaTeX 2e.
%% Based on `crnlphd' class. The following is from the file `crnlphd.dtx':
%% Based loosely on old cuphdthesis style file.
%% Found to give good results, according to the thesis secretary.
%% File: crnlphd.dtx Copyright (C) 1994 Sergio Gelato
%% Made available without any warranty, express or implied.
%% Modifications
%% 03/26/98 Mike Heisler
%% Conform to Eric's final version. Margins are subject to
%% The whim of the printer.
%% 10/10/97 Mike Heisler and Eric Dahl
%% Altered footnotesize and changed the Acknowledgement and
%% Biographical titles per thesis secretary guideline that
%% they must match the rest of the document, i.e. flush left
%% and capitalized rather than all caps
%% 05/21/97 Mike Heisler
%% Added a 'papers' option to handle bibliographis as sections
%% at the end of each chapter. Reduced top margin.
%%
%% $Id$
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%% Digits \0\1\2\3\4\5\6\7\8\9
%% Exclamation \! Double quote \" Hash (number) \#
%% Dollar \$ Percent \% Ampersand \&
%% Acute accent \' Left paren \( Right paren \)
%% Asterisk \* Plus \+ Comma \,
%% Minus \- Point \. Solidus \/
%% Colon \: Semicolon \; Less than \<
%% Equals \= Greater than \> Question mark \?
%% Commercial at \@ Left bracket \[ Backslash \\
%% Right bracket \] Circumflex \^ Underscore \_
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesClass{cornell}
[1998/03/26 v2.0
Cornell University thesis class]
\newif\ifphd
\DeclareOption{phd}{\phdtrue}
\DeclareOption{master}{\phdfalse}
\ExecuteOptions{phd}
\newif\ifpapers
\DeclareOption{papers}{\paperstrue}
\DeclareOption{10pt}{%
\OptionNotUsed%
\ClassWarningNoLine{cornell}{Font size 10pt not allowed; using 12pt}%
}
\DeclareOption{11pt}{%
\OptionNotUsed%
\ClassWarningNoLine{cornell}{Font size 11pt not allowed; using 12pt}%
}
\newcommand{\prelim@contents}[1]{}
\DeclareOption{tocprelim}{%
\renewcommand{\prelim@contents}[1]{\addcontentsline{toc}{section}{#1}}
}
\DeclareOption*{%
\PassOptionsToClass{\CurrentOption}{report}%
}
\ProcessOptions
\LoadClass[12pt]{report}[1994/06/01]
\renewcommand{\defaultscriptratio}{.75}
\renewcommand{\defaultscriptscriptratio}{.6}
\setlength\headsep{25\p@}
\if@twocolumn
\else
\setlength\oddsidemargin{0in}
\setlength\evensidemargin{0in}
\setlength\textwidth{6.5in}
\setlength\topmargin{-0.5in}
\setlength\headheight{0.2in}
\setlength\headsep{0.35in}
\setlength\textheight{8.85in}
\setlength\footskip{0.5in}
\setlength\marginparwidth{0.85in}
\setlength\marginparsep{0.125in}
\fi
\if@compatibility
\setlength\topmargin{0\p@}
\else
\fi
\newcommand{\ps@cornell}{%
\def\@oddhead{{\slshape\rightmark}\hfil\thepage}%
\def\@oddfoot{}%
\def\@evenhead{\thepage\hfil{\slshape\leftmark}}%
\def\@evenfoot{}%
\def\chaptermark##1{}%
\def\sectionmark##1{}%
}
\newcommand{\ps@cornellc}{%
\def\@oddhead{\hfil\thepage\hfil}%
\def\@oddfoot{}%
\def\@evenhead{\@oddhead}%
\def\@evenfoot{}%
\def\chaptermark##1{}%
\def\sectionmark##1{}%
}
\raggedbottom
\newcommand{\@prolformat}[1]{{\begin{flushleft} \Huge #1 \end{flushleft}} }
\newcommand{\ackname}{\@prolformat{Acknowledgements}}
\newcommand{\bioname}{\@prolformat{Biographical Sketch}}
\renewcommand{\contentsname}{\@prolformat{Table of Contents}}
\renewcommand{\listtablename}{\@prolformat{List of Tables}}
\renewcommand{\listfigurename}{\@prolformat{List of Figures}}
\renewcommand{\l@figure}{\@dottedtocline{1}{1.5em}{2.6em}}
\let\l@table\l@figure
\renewenvironment{thebibliography}[1]
{\ifpapers \clearpage \section*{\bibname%
\@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
\else%
\chapter*{\bibname%
\@mkboth{\uppercase{\bibname}}{\uppercase{\bibname}}}%
\fi%
\list{\@biblabel{\arabic{enumiv}}}%
{\settowidth\labelwidth{\@biblabel{#1}}%
\leftmargin\labelwidth
\advance\leftmargin\labelsep
\@openbib@code
\usecounter{enumiv}%
\let\p@enumiv\@empty
\renewcommand\theenumiv{\arabic{enumiv}}}%
\sloppy\clubpenalty4000\widowpenalty4000%
\sfcode`\.\@m\relax
\ifpapers%
\addcontentsline{toc}{section}{\bibname}%
\else%
\addcontentsline{toc}{chapter}{\bibname}%
\fi
\singlespacing}
{\def\@noitemerr
{\@latex@warning{Empty `thebibliography' environment}}%
\normalspacing
\endlist}
\newcommand{\@titlesize}{\Large}
\newcommand{\@subtitlesize}{\large}
\newcommand{\@authorsize}{\normalsize} % No Pharaoh he.
\newcommand{\@conferralmonth}{January}
\newcommand{\@conferralyear}{}
\newcommand{\titlesize}[1]{\renewcommand{\@titlesize}{#1}}
\newcommand{\subtitlesize}[1]{\renewcommand{\@subtitlesize}{#1}}
\newcommand{\authorsize}[1]{\renewcommand{\@authorsize}{#1}}
\newcommand{\conferraldate}[2]{%
\renewcommand{\@conferralmonth}{#1}
\renewcommand{\@conferralyear}{#2}
}
\newcommand{\@degreefield}{Master of Science} %CHANGED
\newcommand{\degreefield}[1]{\renewcommand{\@degreefield}{#1}} %CHANGED
\renewcommand{\maketitle}{%
\begin{titlepage}%
\vspace*{-0.24in}
\begin{center}%
\@titlesize \@title
\end{center}
\vfill
%\begin{center}
%\@subtitlesize
%A \ifphd Dissertation \else Thesis \fi \\ %CHANGED
%Presented to the Faculty of the Graduate School \\
%of Cornell University \\
%in Partial Fulfillment of the Requirements for the Degree of \\
%\ifphd Doctor of Philosophy \else \@degreefield \fi %CHANGED
%\end{center}
\vfill
\begin{center}
\@authorsize
by \\
\@author \\
\@conferralmonth\ \@conferralyear
\end{center}
\vspace*{0.26in}
\end{titlepage}
}
\renewenvironment{titlepage}{%
\typeout{Title page}
\pagestyle{empty}
\doublespacing
}{%
\normalspacing\clearpage
}
\newenvironment{copyrightpage}{%
\typeout{Copyleft page}
\pagestyle{empty}
\null\vfil
\begin{center}
}{%
\end{center}
\vfil\null
\clearpage
}
\newcommand{\makecopyright}{%
\begin{copyrightpage}
\copyright\ \@copyrightholder\ \@copyrightyear \\
ALL RIGHTS RESERVED \\[.5in]
\end{copyrightpage}
}
\newcommand{\@copyrightholder}{\@author}
\newcommand{\@copyrightyear}{\@conferralyear}
\newcommand{\copyrightholder}[1]{\renewcommand{\@copyrightholder}{#1}}
\newcommand{\copyrightyear}[1]{\renewcommand{\@copyrightyear}{#1}}
\newlength{\@abhdskip}
\renewenvironment{abstract}{%
\typeout{Abstract}
\singlespacing
\ifphd %CHANGED
\setlength{\@abhdskip}{.25in}
\addtolength{\@abhdskip}{-\topmargin}
\vspace*{\@abhdskip}
\begin{center}
\@abstracttitle \\
\ \\
\@author \\
\@conferralyear
\end{center}
\vspace{.25in}
\else %CHANGED
\chapter*{%
\begin{center}
\normalsize
ABSTRACT
\end{center}
}
\par
\fi %CHANGED
\pagestyle{empty}
\thispagestyle{empty}
}{%
\clearpage
}
\newcommand{\@abstracttitle}{\@title}
\newcommand{\abstracttitle}[1]{\renewcommand{\@abstracttitle}{#1}}
\newenvironment{biosketch}{%
\typeout{Vita}
\pagestyle{plain}
\pagenumbering{roman}
\setcounter{page}{3}
\prelim@contents{Biographical Sketch}
\chapter*{%
\bioname
}
\par
}{%
\clearpage
}
\newenvironment{dedication}{%
\prelim@contents{Dedication}
\null\vfil
\begin{center}
}{
\end{center}
\vfil\null
\clearpage
}
\newenvironment{acknowledgements}{%
\prelim@contents{Acknowledgments}
\chapter*{%
\ackname
}
\par
}{%
\cleardoublepage
}
\newcommand{\contentspage}{%
\singlespacing
\label{toc}
\prelim@contents{\contentsname}
\tableofcontents
\normalspacing
\clearpage
}
\newcommand{\tablelistpage}{%
\singlespacing
\label{lot}
\prelim@contents{\listtablename}
\listoftables
\normalspacing
\clearpage
}
\newcommand{\figurelistpage}{%
\singlespacing
\label{lof}
\prelim@contents{\listfigurename}
\listoffigures
\normalspacing
\clearpage
}
\newcommand{\abbrlist}{%
\singlespacing
\prelim@contents{List of Abbreviations}
\chapter*{List of Abbreviations}
}
\newcommand{\symlist}{%
\singlespacing
\prelim@contents{List of Symbols}
\chapter*{List of Symbols}
}
\newcommand{\preface}{%
\singlespacing
\prelim@contents{Preface}
\chapter*{Preface}
}
\newcommand{\singlespacing}{%
\let\CS=\@currsize\renewcommand{\baselinestretch}{1.0}\tiny\CS}
\newcommand{\singlespacingplus}{%
\let\CS=\@currsize\renewcommand{\baselinestretch}{1.25}\tiny\CS}
\newcommand{\doublespacing}{%
\let\CS=\@currsize\renewcommand{\baselinestretch}{1.75}\tiny\CS}
\newcommand{\realdoublespacing}{%
\let\CS=\@currsize\renewcommand{\baselinestretch}{2}\tiny\CS}
\newcommand{\normalspacing}{\doublespacing}
\newcommand{\footnotespacing}{\singlespacing}
\newcommand{\changespacing}[2]{%
\renewcommand{#1}{%
\let\CS=\@currsize\renewcommand{\baselinestretch}{#2}\tiny\CS}%
}
\newcommand{\changenormalspacing}[1]{\renewcommand{\normalspacing}{#1}}
\normalspacing
\endinput
%%
%% End of file `cornell.cls'.
+108
View File
@@ -0,0 +1,108 @@
% This file acts as the entry point for AI
\chapter{AI Agent Usage Guide}
\ChapterLabel{AIAgentGuide}
\index{AI agent}
\index{AI agent!DevOps workflow}
\index{Appendix!AI Agent Usage Guide}
\section{How to Use This Appendix}
An AI agent that creates, reviews, or maintains an assignment shall read this
file first. It shall identify the task in the routing table, read the minimum
authoritative sources, and expand context only for a discovered dependency or
inconsistency. This guide is maintained in LaTeX so it is visible, versioned,
and reviewable with the assignment.
\section{Governing Principles}
The authored LaTeX files, versioned automation, and approved assignment
materials are authoritative. The PDF is a review artifact and shall not be
edited directly. AI may draft, explain, analyze, check consistency, and assist
with builds. It shall not invent completion, evidence, access, costs, grades,
approvals, command output, security posture, or operational results.
\section{Chapter File Convention}
\index{AI agent!chapter file convention}
Every assignment chapter shall be stored in exactly one file named with the
\texttt{devops} prefix, a PascalCase chapter name, and the \texttt{.tex}
suffix. For example, Chapter~2 is fully contained in
\path{devopsExampleAssignment.tex}. A chapter file shall begin with its
\texttt{\string\chapter\{...\}} command and contain all of that chapter's
sections and subsections. Do not split one chapter across files, create
section-only \texttt{.tex} files, or use \texttt{\string\input} or
\texttt{\string\include} to assemble a chapter from smaller fragments.
Supporting non-chapter files may use a different name only when they are not
chapter content: \texttt{prologue.tex}, \texttt{abstract.tex},
\texttt{devopsGlossary.tex}, and \texttt{devopsReferences.bib} are examples.
Appendix chapters follow the same chapter-file convention.
\section{AI Quick Start}
\begin{enumerate}
\item Read this guide and identify the requested outcome.
\item Select the closest task below and load only its listed sources.
\item Inspect supplied facts and report consequential gaps or assumptions.
\item Make narrowly scoped changes; preserve stable IDs, glossary terms, and history.
\item Never request, print, store, or commit credentials, tokens, personal data, or production data.
\item Build the complete PDF, inspect the log, visually inspect affected pages, and record material AI use in \ChapterRef{AIPromptLog}.
\end{enumerate}
\section{Task Routing}
\small
\begin{tabularx}{\linewidth}{L{4.0cm}Y}
\caption{AI Task-Routing Table\label{Table:AITaskRouting}}\\
\toprule \textbf{Task} & \textbf{Minimum authoritative sources}\\ \midrule
Initialize an assignment & \texttt{devopsAssignment.tex}, \texttt{prologue.tex}, \texttt{devopsIntroduction.tex}, \texttt{devopsExampleAssignment.tex}, and the instructor's assignment facts.\\
Develop a workflow & \texttt{devopsExampleAssignment.tex}, source repository materials, and authorized environment constraints.\\
Define evidence & \texttt{devopsExampleAssignment.tex} and controlled execution outputs.\\
Review a retrospective & \texttt{devopsExampleAssignment.tex} and the submitted workflow or runbook.\\
Edit AI guidance & \texttt{devopsAIAgentGuide.tex}, \texttt{devopsAIPromptLog.tex}, \texttt{devopsDocumentGuide.tex}, and \texttt{devopsAssignment.tex}.\\
Compile or troubleshoot & \texttt{devopsAssignment.tex}, \texttt{devopsDocumentGuide.tex}, the affected chapter, and the build log.\\ \bottomrule
\end{tabularx}
\normalsize
\section{DevOps-Specific Rules}
\begin{enumerate}
\item Prefer versioned, repeatable automation over undocumented manual steps.
\item Treat deployment output, monitoring data, and screenshots as evidence only when they reflect an actual execution.
\item Design failure exercises to be isolated, reversible, and authorized.
\item Apply least privilege and never place secrets in LaTeX, source control, prompts, screenshots, or logs.
\item State expected cloud cost, cleanup action, and resource ownership for each remote-environment activity.
\item Identify whether a recommendation is a proposal, an instructor directive, or demonstrated evidence.
\end{enumerate}
\section{Example AI Requests}
\subsection{Create an Assignment Brief}
\begin{verbatim}
Read devopsAIAgentGuide.tex and use the Initialize an Assignment context.
From the supplied SSW 590 objective and constraints, fill only supported
placeholders in the introduction and activity brief. Propose clear, observable
completion criteria, a safe cleanup action, and a rubric. Do not invent cloud
access, due dates, policy, costs, or approved tools. Update history, compile,
and report instructor decisions still needed.
\end{verbatim}
\subsection{Review a Student Workflow}
\begin{verbatim}
Read devopsAIAgentGuide.tex and the workflow, evidence, and retrospective
chapters. Review the supplied repository and sanitized evidence for
reproducibility, least privilege, observability, rollback, and cleanup.
Separate verified facts from gaps and recommendations. Do not claim that an
unexecuted command passed, and do not request credentials or operate resources.
\end{verbatim}
\section{Human Decisions and Information Boundaries}
The instructor retains authority over assignment scope, grading, due dates,
approved tooling, access, budgets, security posture, exceptions, and policy.
An AI agent shall surface alternatives and evidence, not represent a decision
as approved. Record material prompts, assumptions, corrections, and unresolved
issues in \ChapterRef{AIPromptLog}.
\section{Completion Checklist}
\begin{itemize}
\item Scope, deliverables, environment, constraints, and cleanup are clear.
\item Activity identifiers and evidence references are valid and unique.
\item Examples contain no secrets, personal data, or unsafe production actions.
\item New controlled terms are added to the glossary and indexed.
\item The newest approved change is recorded in document history.
\item The complete build succeeds with no unresolved references or missing files.
\item A human reviews all decisions requiring instructional or operational authority.
\end{itemize}
+63
View File
@@ -0,0 +1,63 @@
\chapter{AI Prompt Log}
\ChapterLabel{AIPromptLog}
\index{AI prompt log}
\section{How to Use This Appendix}
Use this log when AI assistance materially affects assignment wording,
automation, evidence interpretation, troubleshooting, or feedback. Record
enough context for an instructor or reviewer to understand the input, output,
assumptions, and human corrections. Do not record credentials or personal data.
\section{Example Record}
Date: \textit{[timestamp]}; Tool and model: \textit{[name]}; Task:
\textit{[requested outcome]}; Inputs: \textit{[sanitized constraints and
evidence]}; Output used: \textit{[summary]}; Human review and corrections:
\textit{[summary]}; Unresolved assumptions: \textit{[list or none]}.
\section{Log Entries}
\begin{itemize}
\item \textbf{Project selection.} Date: September 24, 2026. Tool and
model: Claude, model claude-sonnet-5. Task: choose a semester project
satisfying the "master a DevOps technology" option. Inputs: assignment
prompt, rubric, team constraints. Output used: recommendation to master
GitHub Actions, compared against GitLab CI/CD to satisfy the
two-comparable-tools rubric criterion. Human review and corrections:
team selected the direction. Unresolved assumptions: none.
\item \textbf{Project scoping.} Date: September 24, 2026. Tool and model:
Claude, model claude-sonnet-5. Task: apply the DevOps project to the
team's Senior Design project (Scrap) without altering Scrap itself, and
draft the Project Proposal chapter. Inputs: Scrap's Milestone 1 report
and development plan; Project Proposal instructions and rubric. Output
used: recommendation to target Scrap's decoupled companion website only;
full Project Proposal chapter. Human review and corrections: team
confirmed the scoping and confirmed DigitalOcean as the deployment
environment after free alternatives (Google Cloud Run, Oracle Cloud) were
researched and compared. Unresolved assumptions: course team membership
(two-person vs.\ Scrap's three-person team) not explicitly confirmed.
\item \textbf{LaTeX Docker chapter.} Date: September 24, 2026. Tool and
model: Claude, model claude-sonnet-5. Task: build and document a Docker
container that compiles a LaTeX document with TeX Live, using
\texttt{minted}. Inputs: assignment instructions for this chapter.
Output used: \texttt{Dockerfile}, sample \texttt{hello.tex}, and chapter
text. Human review and corrections: LaTeX/Dockerfile logic verified by
direct \texttt{pdflatex} compilation (no Docker available in the
assistant's sandbox); the student ran the actual container and reported
a bug (an empty mounted folder hid the built-in \texttt{hello.tex}),
which was diagnosed and fixed by mounting the project directory instead.
Unresolved assumptions: none.
\item \textbf{Document History update.} Date: September 24, 2026. Tool
and model: Claude, model claude-sonnet-5. Task: update the Document
History table to reflect this assignment's completed chapters. Inputs:
assignment instructions; chapters completed. Output used: consolidated
Document History entry. Human review and corrections: student requested
a single consolidated version entry rather than one per chapter, and
later supplied the report's authoritative Document History text
directly. Unresolved assumptions: chapter labels for the Digital Ocean
Docker Deployment and class-based JavaScript refactor chapters not
confirmed, as the assistant did not create those two chapters.
\end{itemize}
+146
View File
@@ -0,0 +1,146 @@
% SSW 590 DevOps Assignment Template
\documentclass[12pt]{cornell}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{xspace}
\usepackage{xcolor}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{amsmath,amssymb}
\usepackage{array}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{ltablex}
\keepXColumns
\usepackage{enumitem}
\usepackage{listings}
\usepackage{tcolorbox}
\usepackage{makeidx}
\usepackage[colorlinks=true,citecolor=blue,linkcolor=blue,urlcolor=blue]{hyperref}
\usepackage[acronym,toc]{glossaries}
\usepackage{float}
% Cache minted outputs to prevent Overleaf free-plan timeouts
\usepackage[cache=true]{minted}
\makeindex
\makeglossaries
\input{devopsGlossary.tex}
\definecolor{devopsBlue}{RGB}{31,78,121}
\definecolor{devopsGreen}{RGB}{46,125,50}
\definecolor{devopsRed}{RGB}{183,28,28}
\definecolor{devopsGray}{RGB}{90,90,90}
\definecolor{devopsLightBlue}{RGB}{232,240,247}
\newcommand{\DocumentStatus}{Final}
\newcommand{\CourseNumber}{SSW 590}
\newcommand{\CourseName}{DevOps}
\newcommand{\Instructor}{Samah Keshiro and Kayla Holmes}
\newcommand{\Organization}{Stevens Institute of Technology}
\newcommand{\DocumentDate}{10/10/26}
\newcommand{\DueDate}{[Due Date and Time]}
\newcommand{\VERSION}{Version 1.5}
\newcommand{\AssignmentNumber}{5}
\newcolumntype{Y}{>{\raggedright\arraybackslash}X}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\setlength{\tabcolsep}{4pt}
\renewcommand{\arraystretch}{1.12}
\setlength{\LTpre}{6pt}
\setlength{\LTpost}{6pt}
\newcommand{\ArtifactLabel}[2]{\phantomsection\label{#1:#2}}
\newcommand{\ArtifactID}[2]{\texttt{#2}\ArtifactLabel{#1}{#2}\index{#1!#2}}
\newcommand{\ArtifactRef}[2]{\hyperref[#1:#2]{\texttt{#2}}}
\newcommand{\ActivityID}[1]{\ArtifactID{Activity}{#1}}
\newcommand{\ActivityRef}[1]{\ArtifactRef{Activity}{#1}}
\newcommand{\EvidenceID}[1]{\ArtifactID{Evidence}{#1}}
\newcommand{\EvidenceRef}[1]{\ArtifactRef{Evidence}{#1}}
\newcommand{\ChapterLabel}[1]{\label{Chapter:#1}}
\newcommand{\ChapterRef}[1]{\hyperref[Chapter:#1]{Chapter~\ref*{Chapter:#1}}}
\newcommand{\StatusPass}{\textbf{\footnotesize\textcolor{devopsGreen}{PASS}}}
\newcommand{\StatusPending}{\textbf{\footnotesize\textcolor{devopsGray}{PENDING}}}
\newcommand{\StatusFail}{\textbf{\footnotesize\textcolor{devopsRed}{FAIL}}}
\newtcolorbox{devopsNote}[1][]{
colback=devopsLightBlue, colframe=devopsBlue, boxrule=0.6pt, arc=1mm, title=#1
}
\lstdefinestyle{cmdstyle}{
backgroundcolor=\color{blue!6},
basicstyle=\ttfamily\small\color{blue!65!black},
frame=single,
framerule=0.3pt,
rulecolor=\color{blue!40},
breaklines=true,
columns=fullflexible,
xleftmargin=2pt, xrightmargin=2pt,
}
\lstdefinestyle{outstyle}{
backgroundcolor=\color{black!5},
basicstyle=\ttfamily\small,
frame=single,
framerule=0.3pt,
rulecolor=\color{black!30},
breaklines=true,
columns=fullflexible,
xleftmargin=2pt, xrightmargin=2pt,
}
\lstset{
backgroundcolor=\color{white}, basicstyle=\ttfamily\footnotesize,
breaklines=true, frame=single, keywordstyle=\color{blue},
commentstyle=\color{devopsGreen}, numbers=left, numbersep=6pt,
numberstyle=\tiny\color{devopsGray}, showstringspaces=false,
stringstyle=\color{devopsRed}, tabsize=2
}
\changenormalspacing{\singlespacing}
\begin{document}
\pagenumbering{roman}
\singlespacing
\include{prologue}
% Display build metadata generated by Gitea Actions.
\IfFileExists{build-metadata.tex}{
\input{build-metadata.tex}
}{
\textit{Build metadata is available in automated builds.}
}
% Adds in variables for title page
\setcounter{page}{1}
\pagenumbering{arabic}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\lhead{\small Assignment \AssignmentNumber}
\chead{\small\nouppercase{\leftmark}}
\rhead{\small\thepage}
\lfoot{\small\CourseNumber}
\cfoot{\small\copyright\ \Organization}
\rfoot{\small\VERSION}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\include{devopsLinux}
\include{devopsDigitalOcean}
\include{devopsWebsites}
\include{devopsLatexDocker}
\include{devopsProjectProposal}
\include{devopsJenkinsCI}
\include{devopsPasswordsAndHosts}
\include{devopsAutomatedManualBuild}
\include{devopsCI}
\include
\bibliographystyle{IEEEtran}
\bibliography{devopsReferences}
\appendix
\include{devopsAIPromptLog}
\end{document}
+261
View File
@@ -0,0 +1,261 @@
\chapter{Automated Manual Build}
\ChapterLabel{AutomatedManualBuild}
\index{Gitea Actions}
\index{automated manual build}
% ---------------------------------------------------------------------------
% Bracketed italic text marks evidence that is added once the runner is online
% and a real workflow run exists. Replace each placeholder with the actual
% value or screenshot; do not fill them in before the run has happened.
% ---------------------------------------------------------------------------
\section{Source and Trigger}
\textbf{Repository and files:}
\begin{description}
\item[Repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web}
\item[Manual source folder:]
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual}
\item[Main file:]
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/manual/devopsAssignment.tex}
\item[Workflow:]
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/.gitea/workflows/manual.yml}
\item[Tracking issue:]
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/issues/8}
\item[Pull request:] \textit{[link to the merged pull request from
\texttt{issue-8} into \texttt{main}]}
\end{description}
The manual is stored in the \texttt{manual/} folder of the team's existing
product repository, Scrap-Web, rather than in a separate repository. The
complete buildable project is version-controlled there: every chapter file,
the \texttt{cornell.cls} document class, the \texttt{IEEEtran.bst}
bibliography style, \texttt{devopsReferences.bib}, the glossary, and all
figures under \texttt{HW2 images/} and \texttt{HW4 images/}. Generated files
(PDF, \texttt{.aux}, \texttt{.log}, minted cache, and so on) are excluded by
\texttt{manual/.gitignore}, so the repository holds source only. The
repository is the source of truth; the PDF is never edited directly.
\textbf{How the source was added:} the manual was committed on the branch
\texttt{issue-8} (tracked by issue \#8), pushed to Gitea, and merged into
\texttt{main} through a pull request. Work on the website itself happens on
other branches and is unaffected.
\textbf{Selected branch and event:} the workflow runs on a \texttt{push} to
\texttt{main}. A path filter limits it to pushes that change
\texttt{manual/**} or the workflow file itself, so website-only commits do
not rebuild the manual. Merging a pull request into \texttt{main} counts as
such a push. The workflow can also be started by hand from the Actions tab
(\texttt{workflow\_dispatch}).
\textit{[Figure: Actions tab showing a run triggered by the merge commit into
\texttt{main}, dated.]}
\textbf{Git remote and network path:} team members push over HTTPS. The
remote is configured as:
\begin{verbatim}
$ git remote -v
origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (fetch)
origin https://git.ssw590-08.me/SSW-590-08/Scrap-Web.git (push)
\end{verbatim}
\begin{center}
\begin{tabular}{lll}
\toprule
Hop & Port & Exposure \\
\midrule
Laptop $\rightarrow$ Caddy (TLS proxy) & 443/TCP (HTTPS) & Public \\
Caddy $\rightarrow$ Gitea web service & 3000/TCP (HTTP) & Private Docker network only \\
\bottomrule
\end{tabular}
\end{center}
A \texttt{git push} connects to \texttt{git.ssw590-08.me} on port 443,
exactly as a browser does. Caddy terminates TLS and forwards the request over
the internal Docker network to Gitea on port 3000, which is not published to
the internet. Gitea's public root URL is set to
\url{https://git.ssw590-08.me/}, so clone URLs and links point at the HTTPS
hostname. SSH pushes are not needed for this assignment.
\textbf{Why the runner needs no public port:} the runner never receives
connections. It contacts Gitea outbound over HTTPS to register and to poll
for jobs; the job then checks out the source and uploads the PDF over the
same HTTPS URL. Because all traffic is initiated by the runner, no submission
or management port has to be opened for it.
\section{Runner Setup}
\textit{[To be completed with the runner registration (Part 2): version,
location, scope, label \texttt{latex}, execution mode, capacity, network path,
and a screenshot of the runner online with a job assigned.]}
\section{Reproducible Compilation}
\begin{description}
\item[Main file:] \texttt{manual/devopsAssignment.tex}
\item[Build command:] \texttt{latexmk devopsAssignment.tex}, run in the
\texttt{manual/} folder
\item[Build configuration:] \texttt{manual/.latexmkrc}
\item[Expected PDF path:] \texttt{manual/devopsAssignment.pdf}
\item[Job image definition:] \texttt{manual/ci/Dockerfile}
\item[Base image:] \texttt{texlive/texlive:TL2025-historic}
\item[Resolved image ID/digest:] \textit{[from the runner host]}
\end{description}
\textbf{Where TeX runs:} the compiler is not installed in the Gitea
container. The workflow targets the runner label \texttt{latex}
(\texttt{runs-on: latex}), which maps to a job image built from
\texttt{manual/ci/Dockerfile}. That image is the official TeX Live image,
which already contains \texttt{pdflatex}, \texttt{latexmk}, \texttt{bibtex},
\texttt{makeindex}, \texttt{makeglossaries}, and Python with Pygments (needed
by the \texttt{minted} package). The Dockerfile adds only Node.js and Git from
the image's own Debian package repositories, which the checkout and upload
actions require; no external script is downloaded and executed. The base
image uses a fixed TeX Live release tag rather than \texttt{latest}, so every
build uses the same toolchain.
\textbf{Build command and dependencies:} all compiler options are stored in
\texttt{manual/.latexmkrc}, so the same command works on a laptop and in the
workflow:
\begin{minted}[breaklines]{perl}
$pdf_mode = 1;
$pdflatex = 'pdflatex -shell-escape -interaction=nonstopmode -halt-on-error -file-line-error %O %S';
add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');
sub run_makeglossaries { return system("makeglossaries \"$_[0]\""); }
\end{minted}
\texttt{latexmk} runs \texttt{pdflatex} as many times as needed and calls
\texttt{bibtex}, \texttt{makeindex}, and \texttt{makeglossaries} when their
inputs change. \texttt{-shell-escape} is required by \texttt{minted}.
\textbf{Workflow:} the complete workflow file is shown below.
\begin{minted}[breaklines]{yaml}
name: Build IT manual
on:
push:
branches: [main]
paths:
- 'manual/**'
- '.gitea/workflows/manual.yml'
workflow_dispatch:
jobs:
build-manual:
runs-on: latex
defaults:
run:
shell: bash
steps:
- name: Check out the triggering commit
uses: actions/checkout@v4
- name: Record build identity and toolchain
run: |
SHORT_SHA="${GITHUB_SHA::7}"
echo "SHORT_SHA=${SHORT_SHA}" >> "$GITHUB_ENV"
echo "Commit: ${GITHUB_SHA} (${SHORT_SHA})"
echo "Run number: ${GITHUB_RUN_NUMBER}"
pdflatex --version | head -n 1
latexmk -v | head -n 2 | tail -n 1
python3 -c "import pygments; print('Pygments', pygments.__version__)"
- name: Compile the manual
working-directory: manual
run: latexmk devopsAssignment.tex
- name: Verify the PDF exists
working-directory: manual
run: |
if [ ! -s devopsAssignment.pdf ]; then
echo "ERROR: manual/devopsAssignment.pdf is missing or empty"
exit 1
fi
ls -l devopsAssignment.pdf
- name: Upload the PDF as an artifact
uses: actions/upload-artifact@v4
with:
name: it-manual-build-${{ github.run_number }}-${{ env.SHORT_SHA }}
path: manual/devopsAssignment.pdf
if-no-files-found: error
retention-days: 30
\end{minted}
\textbf{Failure detection:} the build fails in three independent ways.
\begin{enumerate}
\item A LaTeX error stops \texttt{pdflatex} immediately
(\texttt{-halt-on-error}); \texttt{latexmk} then exits with a non-zero
code, which fails the \emph{Compile the manual} step. The log shows the
failing file and line (\texttt{-file-line-error}).
\item If compilation reports success but the PDF is missing or empty, the
\emph{Verify the PDF exists} step exits with code 1 and prints an error.
\item The upload step uses \texttt{if-no-files-found: error}, so it cannot
silently upload nothing.
\end{enumerate}
A failed step stops the job, so no artifact is produced from a broken build.
\textbf{Checkout and upload without a shared filesystem:} the job container
shares no files with Gitea. The \texttt{actions/checkout} step clones the
exact triggering commit from Gitea over HTTPS, the compile happens inside the
temporary job container, and \texttt{actions/upload-artifact} sends the PDF
back to Gitea over HTTPS, where it is attached to the matching run. The
container is discarded when the job ends.
\textit{[Link to a successful run log, and a dated screenshot of the
compile and verify steps passing.]}
\section{PDF Version Traceability}
\textit{[To be completed (Part 4): human-maintained version, generated build
identifier such as \texttt{v1.4+build.N.abcdef0}, visible commit hash and run
number in the PDF, matching Gitea run, and how the metadata is injected
without committing back to the branch.]}
\section{Downloadable Artifact}
\begin{description}
\item[Artifact name:] \texttt{it-manual-build-\textit{N}-\textit{H}},
where \textit{N} is the workflow run number and \textit{H} is the short
commit hash; for example, \texttt{it-manual-build-12-a1b2c3d}
\item[Contents:] \texttt{devopsAssignment.pdf}
\item[Retention:] 30 days, set in the workflow
(\texttt{retention-days: 30}). \textit{[Confirm the server's maximum
artifact retention; Gitea applies the lower of the two.]}
\item[Example artifact link:] \textit{[link to the artifact on a successful
run]}
\end{description}
Because the run number and commit hash are part of the artifact name, each
downloaded file can be matched to the run and commit that produced it.
\textbf{How a team member downloads the PDF:}
\begin{enumerate}
\item Open \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/actions}.
\item Select the \emph{Build IT manual} workflow and open the run for the
commit of interest (the run lists its commit hash and branch).
\item Confirm the run finished successfully.
\item In the run's \emph{Artifacts} section, click
\texttt{it-manual-build-\ldots} to download it, then extract and open
\texttt{devopsAssignment.pdf}.
\end{enumerate}
Artifacts expire after the retention period and are not a backup. The
permanent record is the LaTeX source in Git, from which any version of the
manual can be rebuilt.
\textit{[Figure: run page with the artifact listed, and the downloaded PDF
open, dated.]}
\section{Change, Failure, and Repair Evidence}
\textit{[To be completed together (Part 6): two successive commits with
their runs and PDF identifiers, one deliberate LaTeX error with its failed
run, and the repaired passing run.]}
\section{Runner and Secret Boundary}
\textit{[To be completed (Part 7): workflow edit rights, where the runner
registration token is stored (without its value), runner isolation, and
Docker socket risk.]}
\section{Manual Quality and Controls}
\textit{[To be completed (Part 8): version and history update, whether the
Hosts and Passwords tables changed, and a short failed-build troubleshooting
procedure.]}
+937
View File
@@ -0,0 +1,937 @@
\chapter{Continuous Integration with Jenkins}
\ChapterLabel{ContinuousIntegration}
\index{Jenkins}
\index{continuous integration}
\section{Jenkins Deployment and Persistence}
\label{sec:ci-deploy}
Jenkins was deployed on the existing DigitalOcean Droplet used for the Gitea environment. The deployment uses the official Jenkins Docker image, \texttt{jenkins/jenkins}, which specifies the Long-Term Support (LTS) release with Java 21. The running Jenkins instance reported version \texttt{2.580.1} and Java 21.
Jenkins was deployed as a Docker Compose service rather than installed directly on the host operating system. This approach makes the service configuration reproducible and allows the container to be managed independently of the other services running on the Droplet. The Jenkins container is named \texttt{jenkins}.
The Docker Compose configuration defines the Jenkins image, container name, restart policy, Java memory settings, persistent storage, and shared Docker network. The configuration file is located at \texttt{/root/jenkins/docker-compose.yml} on the Droplet. The corresponding source-controlled configuration should be linked here for reproducibility.
The relevant configuration is shown below. It contains no passwords, personal access tokens, or other authentication secrets.
\begin{minted}[fontsize=\small,breaklines,linenos]{yaml}
services:
jenkins:
image: jenkins/jenkins
container_name: jenkins
restart: unless-stopped
environment:
JAVA_OPTS: "-Xms256m -Xmx512m"
volumes:
- jenkins-home:/var/jenkins_home
networks:
- gitea-net
volumes:
jenkins-home:
name: jenkins_home
networks:
gitea-net:
external: true
name: gitea-net
\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]}.
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/}.
\subsection{Droplet Capacity and Resource Allocation}
The DigitalOcean Droplet was upgraded to the plan providing 2 GB of RAM, one virtual CPU, and a 50 GB SSD. The host runs Jenkins alongside Gitea and Caddy, so the available resources are shared among these services.
The Jenkins container is configured with the following Java heap limits:
\begin{itemize}
\item Initial Java heap size: 256 MB.
\item Maximum Java heap size: 512 MB.
\end{itemize}
After the Droplet upgrade, the reported host memory usage was approximately 503 MiB used out of 1.9 GiB, with approximately 931 MiB free and 1.4 GiB available. The reported disk usage was approximately 3.3 GB out of 48 GB, leaving approximately 45 GB available. These values describe the host at the time of measurement and may change as builds execute and logs accumulate.
Because the Droplet hosts several services on a relatively small resource allocation, memory and disk usage should be monitored during builds. The Java heap limit helps constrain Jenkins' Java memory allocation, but it does not represent a limit on the container's total memory usage.
\subsection{Persistent Storage and Restart Policy}
Jenkins stores its configuration, job definitions, plugins, and other Jenkins home data under \texttt{/var/jenkins\_home}. The Compose configuration mounts this directory to the named Docker volume \texttt{jenkins\_home}. This separates Jenkins application data from the container's writable filesystem and allows the data to survive replacement or restart of the container, provided that the named volume is retained.
The container uses the Docker restart policy \texttt{unless-stopped}. This policy allows Docker to restart Jenkins after an unexpected container exit and when Docker restarts, unless the container has been explicitly stopped.
The following commands can be used to inspect the running container and verify its storage and restart settings:
\begin{minted}[fontsize=\small,breaklines]{bash}
docker inspect jenkins \
--format 'Restart policy: {{.HostConfig.RestartPolicy.Name}}'
docker inspect jenkins \
--format '{{json .Mounts}}'
docker inspect jenkins \
--format '{{json .HostConfig.PortBindings}}'
\end{minted}
The deployment inspection confirmed the \texttt{unless-stopped} restart policy and the \texttt{jenkins\_home} volume mounted at \texttt{/var/jenkins\_home}. It also confirmed that the container has no host port bindings for Jenkins' internal ports.
\subsection{Container Restart Test}
A container restart test was performed using the following command:
\begin{minted}[fontsize=\small,breaklines]{bash}
docker restart jenkins
\end{minted}
The command completed successfully. Following the restart, Jenkins was accessible through its HTTPS address, and the existing Jenkins configuration and job remained available. This demonstrated that Jenkins could restart without requiring the service to be reinstalled or configured from scratch.
The test also supports the use of the named \texttt{jenkins\_home} volume for persistent Jenkins data. A container restart is not, however, a backup or disaster-recovery test. It does not demonstrate that data can be recovered after volume deletion, disk failure, Droplet loss, or corruption. Separate backups of the Jenkins home data and a documented restoration procedure are necessary to establish recoverability.
\section{HTTPS, Access, and Firewall}
\label{sec:ci-https}
\subsection{Jenkins Login URL and Access Path}
Jenkins is accessible through the following HTTPS address:
\begin{center}
\url{https://ci.ssw590-08.me/}
\end{center}
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]}.
\subsection{DNS and TLS Certificate}
The DNS record for \texttt{ci.ssw590-08.me} is configured to point to the public IP address of the DigitalOcean Droplet. The hostname is used to distinguish the Jenkins service from the existing Gitea service, which is available at \url{https://git.ssw590-08.me/}.
Caddy serves as the HTTPS reverse proxy for Jenkins. Its configuration includes the following site definition:
\begin{minted}[fontsize=\small,breaklines,linenos]{text}
ci.ssw590-08.me {
encode gzip
reverse_proxy jenkins:8080
}
\end{minted}
Caddy terminates the incoming HTTPS connection and forwards the request to the Jenkins container at \texttt{jenkins:8080} on the shared Docker network. The configuration was validated successfully with \texttt{caddy validate} and subsequently reloaded.
The certificate details should be recorded from the certificate actually presented by the deployed service:
\begin{itemize}
\item \textbf{Hostname:} \texttt{ci.ssw590-08.me}
\item \textbf{Certificate issuer:} [INSERT VERIFIED CERTIFICATE ISSUER]
\item \textbf{Certificate expiration:} [INSERT VERIFIED EXPIRATION DATE]
\item \textbf{Certificate verification date:} [INSERT DATE]
\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.
\subsection{HTTP-to-HTTPS Redirect and Jenkins Proxy Configuration}
The public web entry point is Caddy, which handles incoming HTTP and HTTPS traffic. The expected browser-facing behavior is that HTTP requests to the Jenkins hostname redirect to HTTPS. This behavior should be documented using a dated test of the deployed endpoint rather than inferred solely from the configuration.
The redirect can be checked from an external machine with:
\begin{minted}[fontsize=\small,breaklines]{bash}
curl -sSI http://ci.ssw590-08.me/
curl -sSI https://ci.ssw590-08.me/
\end{minted}
The first command should be checked for an HTTP redirect to the HTTPS URL. The second verifies the HTTPS response and helps confirm that the endpoint is reachable with TLS.
Jenkins is configured to use the externally accessible URL:
\begin{center}
\url{https://ci.ssw590-08.me/}
\end{center}
This URL should also be configured in Jenkins under \textit{Manage Jenkins} $\rightarrow$ \textit{System} $\rightarrow$ \textit{Jenkins Location}. The configured Jenkins URL must match the public HTTPS address so that generated links and integrations use the correct hostname. Caddy handles the external TLS connection and proxies requests to the Jenkins service internally.
\subsection{Accounts and Authorization}
Jenkins requires authentication to access its administrative interface and configure continuous integration jobs. Access to Jenkins administration and configuration should be restricted to authorized project members.
The Gitea integration uses a dedicated \texttt{jenkins} account and a Gitea Personal Access Token stored in Jenkins credentials. The account has the repository permissions needed for Jenkins to interact with \texttt{SSW-590-08/Scrap-Web}. During integration troubleshooting, repository webhook management initially failed with HTTP 403 responses. The account's repository permissions were subsequently adjusted, and the Jenkins webhook was created successfully in Gitea.
The following account and role information should be completed based on the actual Jenkins security configuration:
\begin{itemize}
\item \textbf{Jenkins administrators:} [INSERT AUTHORIZED ADMINISTRATOR ACCOUNTS OR ROLES]
\item \textbf{Jenkins users:} [INSERT AUTHORIZED USER ACCOUNTS OR ROLES]
\item \textbf{Gitea integration identity:} \texttt{jenkins}
\item \textbf{Credential storage:} Jenkins Credentials
\end{itemize}
Personal access tokens and passwords are not included in this report. The dedicated integration account should have only the permissions required for repository access, webhook management, and build-status reporting.
\subsection{DigitalOcean Cloud Firewall}
The deployment uses the DigitalOcean Cloud Firewall named \texttt{gitea-firewall}. The firewall controls which inbound connections can reach the Droplet. The intended inbound access includes SSH administration and the public web ports required by Caddy.
The relevant public TCP ports are:
\begin{itemize}
\item \textbf{TCP 22:} SSH administration.
\item \textbf{TCP 80:} HTTP access and HTTPS redirection.
\item \textbf{TCP 443:} HTTPS access through Caddy.
\item \textbf{TCP 222:} Gitea SSH access, where required by the existing deployment.
\end{itemize}
Direct public access to Jenkins on TCP 8080 is not required. The Jenkins container does not publish ports 8080 or 50000 on the Droplet's host network. Likewise, the Gitea web interface is reached through Caddy rather than by exposing its internal TCP port 3000.
The host's UFW firewall was reported as inactive during deployment verification. Consequently, the DigitalOcean Cloud Firewall and Docker's network and port configuration are important parts of the external access restrictions.
The actual Cloud Firewall rules should be captured in a dated screenshot and compared with the rules listed above. Unneeded inbound rules, including direct public access to TCP 3000 and TCP 5432, should be removed if they are not required by another service.
\subsection{Docker Port Mappings}
The Jenkins Compose service joins the existing \texttt{gitea-net} Docker network. It does not define a \texttt{ports} mapping for Jenkins. Inspection of the running container confirmed that Jenkins' internal TCP ports 8080 and 50000 have no host port bindings.
The container's port configuration was inspected with:
\begin{minted}[fontsize=\small,breaklines]{bash}
docker inspect jenkins \
--format '{{json .HostConfig.PortBindings}}'
docker inspect jenkins \
--format '{{json .NetworkSettings.Ports}}'
\end{minted}
The inspection results showed no published host bindings for the Jenkins web interface or agent port. External browser traffic is instead routed through Caddy, which forwards requests to \texttt{jenkins:8080} over the internal Docker network.
This arrangement avoids exposing Jenkins' application port directly to the public Internet and provides a single HTTPS entry point for browser access.
\subsection{External Connectivity Tests}
External tests were performed from a machine outside the Droplet to verify that selected ports were reachable or blocked from the public network. The test results must be recorded with their execution date and the source machine's network context.
The following command tests the public IPv4 address for TCP connectivity:
\begin{minted}[fontsize=\small,breaklines]{bash}
nc -vz -w 3 147.182.179.191 443
nc -vz -w 3 147.182.179.191 8080
\end{minted}
The expected results are:
\begin{itemize}
\item \textbf{TCP 443:} The connection should succeed because Caddy provides the public HTTPS endpoint.
\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}
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.
The test record should include:
\begin{itemize}
\item \textbf{Test date and time:} [INSERT DATE, TIME, AND TIME ZONE]
\item \textbf{Test source:} [INSERT EXTERNAL MACHINE OR NETWORK]
\item \textbf{Droplet IPv4 address:} \texttt{147.182.179.191}
\item \textbf{TCP 443 result:} [INSERT OBSERVED RESULT]
\item \textbf{TCP 8080 result:} [INSERT OBSERVED RESULT]
\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.
\section{Gitea Trigger and Traceability}
\label{sec:ci-trigger}
\subsection{Deployment and Network Paths}
Figure~\ref{fig:ci-deployment} adapts the reference deployment to the team's
actual setup. Gitea and Jenkins run as containers on the same DigitalOcean
Droplet behind the Caddy TLS proxy. Two paths are separate:
\begin{itemize}
\item \textbf{Browser path:} a team member's browser reaches
\url{https://ci.ssw590-08.me} on port 443 through the Cloud Firewall and
Caddy, which forwards to Jenkins on the private Docker network. Jenkins'
own port 8080 is not published (Section~\ref{sec:ci-https}).
\item \textbf{Integration path:} Jenkins initiates every connection to
Gitea. It calls the Gitea API at \url{https://git.ssw590-08.me} to
discover branches and pull requests, clones the pull request's head
commit, and posts the commit status back. Gitea never needs to reach
Jenkins for builds to run, because the job polls for changes
(Section~\ref{sec:ci-trigger-config}).
\end{itemize}
\begin{figure}[H]
\centering
% Uncomment once the diagram image is uploaded:
% \includegraphics[width=\linewidth]{HW6 images/ci-deployment.png}
\fbox{\parbox[c][3cm][c]{0.9\linewidth}{\centering\textit{[Diagram to be added]}}}
\caption{Adapted UML deployment diagram of the Gitea and Jenkins CI paths}
\label{fig:ci-deployment}
\end{figure}
\subsection{Repository and Integration Identity}
\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, global scope)
\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}
\item it is a \emph{restricted} account, so it can see only repositories it
is explicitly added to, and it is not a site administrator;
\item it is a collaborator on Scrap-Web only, with \emph{Write} access
(Figure~\ref{fig:ci-collaborators}). Write is the minimum Gitea requires
to set commit statuses. It cannot push to \texttt{main}, which is
protected (Section~\ref{sec:ci-gate});
\item its token, named \texttt{jenkins} and created on October 22, 2026,
has only the permissions \texttt{write:repository} and
\texttt{read:user} (Figure~\ref{fig:ci-token}). The token value is stored
only in the Jenkins credential store (Section~\ref{sec:ci-credentials}).
\end{itemize}
\begin{figure}[H]
\centering
\includegraphics[width=0.85\linewidth]{HW6 images/collaborators.png}
\caption{October 23, 2026 --- Scrap-Web collaborators: the integration
account \texttt{jenkins-ci} and team member \texttt{kholmes}, both with
Write access.}
\label{fig:ci-collaborators}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=0.7\linewidth]{HW6 images/token-scopes.png}
\caption{October 23, 2026 --- The \texttt{jenkins-ci} account's access
token \texttt{jenkins} and its permissions. Gitea does not display the
token value.}
\label{fig:ci-token}
\end{figure}
\subsection{Job Configuration and Trigger}
\label{sec:ci-trigger-config}
The Multibranch Pipeline job uses the Jenkins Gitea plugin~\cite{JenkinsGiteaPlugin}
as its branch source, pointed at owner \texttt{SSW-590-08} and repository
\texttt{Scrap-Web} through the \texttt{Gitea} server entry
(\url{https://git.ssw590-08.me}) and the \texttt{gitea-jenkins-ci}
credential (Figure~\ref{fig:ci-branch-source}). Its relevant settings are:
\begin{tabularx}{\linewidth}{L{4.6cm}Y}
\toprule
\textbf{Setting} & \textbf{Value and reason}\\ \midrule
Discover branches & Strategy: \emph{only branches that are not also filed
as PRs}. \texttt{main} is built as a branch; a feature branch with an open
pull request is built once, as that pull request, not twice.\\
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 & Strategy: \emph{the current pull
request revision}; 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}
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{HW6 images/branch-source.png}
\caption{October 23, 2026 --- Branch source settings of the
\texttt{Scrap-Web} Multibranch Pipeline job.}
\label{fig:ci-branch-source}
\end{figure}
\textbf{Trigger: polling fallback.} The job scans Scrap-Web every minute and
starts a build for any branch or pull request whose head commit has changed.
The assignment permits polling in place of a webhook. It was chosen because a
webhook from Gitea to Jenkins on the private container network requires
changing Gitea's allowed webhook hosts, and Jenkins' web interface was not
opened merely to receive webhooks. The cost is a delay of up to one minute
between a push and the start of its build. In practice, each push in
Section~\ref{sec:ci-failure} was built within about two minutes.
Each scan is recorded in the job's \emph{Scan Repository Log}
(Figure~\ref{fig:ci-scan-log}). The scan at 04:15 UTC on October 23, 2026
(00:15 Eastern) found pull request \#13, confirmed that it contains a
\texttt{Jenkinsfile} (``Met criteria''), and recorded its head commit
\texttt{b899233}. Branches and pull requests without a \texttt{Jenkinsfile}
were checked and skipped.
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{HW6 images/scan-log.png}
\caption{October 23, 2026, 04:15 UTC --- Scan Repository Log: pull
request \#13 discovered at commit \texttt{b899233}.}
\label{fig:ci-scan-log}
\end{figure}
\subsection{Traceability: Commit to Jenkins Run}
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's Checkout log (\texttt{git rev-parse HEAD}), and on the status Gitea
displays for that commit (Figure~\ref{fig:ci-pr-fail-fix}).
\begin{tabularx}{\linewidth}{L{4.2cm}Y}
\toprule
\textbf{Item} & \textbf{Value}\\ \midrule
Event & Repair commit pushed to branch \texttt{feature/issue-11}, the source
of pull request \#13\\
Time & October 23, 2026; Jenkins run started at 11:07 PM\\
Detected by & Repository scan (polling); build started automatically\\
Pull request & \#13,
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}\\
Triggering commit & \texttt{84a44f0477}\\
Jenkins run & \texttt{Scrap-Web/PR-13} run \#9 (Figure~\ref{fig:ci-runs};
the job was later removed by Jenkins, see below)\\
Status posted to Gitea & \texttt{Scrap-Web/pipeline/pr-main}: success,
visible on the commit in
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{pull
request \#13's commit list}\\
\bottomrule
\end{tabularx}
\subsection{Where Checkout and Tests Run}
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
each run lists the node as \emph{Jenkins} (the built-in node,
Figure~\ref{fig:ci-stage-view}). There is no separate build agent and no inbound
agent port. Jenkins clones the commit from Gitea over HTTPS into its
workspace under \texttt{/var/jenkins\_home/workspace/} and runs the
\texttt{Jenkinsfile} stages there (Section~\ref{sec:ci-pipeline}). The risk
of building on the controller and the restrictions that limit it are covered
in Section~\ref{sec:ci-credentials}.
\subsection{Failure Diagnoses}
Four integration problems were diagnosed and corrected.
\textbf{Repository not visible to Jenkins.} When the job was first
configured, the Repository list for owner \texttt{SSW-590-08} was empty,
even though the token had repository access. \textit{[Cause and fix.]}
After the correction the repository appeared and the first scan discovered
pull request \#13 (Figure~\ref{fig:ci-scan-log}).
\textbf{First build failed: \texttt{python3: not found}.} Run \#1 of
\texttt{PR-13} (October 23, 2026, 00:13) checked out the commit
successfully, proving the integration worked, but failed in the Checkout
stage at \texttt{python3 --version} with exit code 127; the later stages were
skipped (Figure~\ref{fig:ci-runs}). The official Jenkins image does not
include Python. The fix was a deployment change, not a code change:
\texttt{python3} was added to the Jenkins container \textit{[confirm how:
e.g.\ by building it from \texttt{jenkins/Dockerfile}]}. Run \#2, started
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
requirement was added, Gitea showed the Jenkins check as green but still
reported ``some required checks are missing'' and blocked the merge.
\textit{[Cause and fix.]}
\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
Jenkins. The pull request was closed, and the Multibranch job's default
orphaned item strategy discards the jobs of closed pull requests. Deleted
runs cannot be restored without a backup of \texttt{jenkins\_home}. The
evidence survives in Gitea, because the commit statuses Jenkins posted remain
attached to each commit of pull request \#13, and in the screenshots captured
while the runs existed. To keep future evidence, the job's \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
Section~\ref{sec:ci-troubleshoot}.
\section{Versioned Pipeline and Tests}
\label{sec:ci-pipeline}
\begin{description}
\item[Repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web}
\item[Jenkinsfile:]
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/src/branch/main/Jenkinsfile}{\texttt{Jenkinsfile} on \texttt{main}}
\item[Application:] \texttt{pricing.py} (repository root)
\item[Tests:] \texttt{tests/test\_pricing.py}
\end{description}
The pipeline tests a small pricing module, \texttt{pricing.py}, using the
optional Python application provided with the assignment. Its function
\texttt{total\_price(unit\_price, quantity)} returns the price of an order and
rejects quantities below one. The module, its tests, and the
\texttt{Jenkinsfile} are committed together at the root of the Scrap-Web
repository, so every \gls{pullrequest} carries the exact code, tests, and pipeline
definition that Jenkins runs.
\subsection{Pipeline Stages}
The \gls{jenkinsfile} is a Declarative Pipeline~\cite{JenkinsPipeline} with three stages. Each
stage fails the run if its command exits with a non-zero code, and later
stages do not run after a failure, so the stage view shows exactly where a
problem occurred.
\begin{tabularx}{\linewidth}{L{2.2cm}L{4.6cm}Y}
\toprule
\textbf{Stage} & \textbf{Command} & \textbf{Purpose and expected result}\\ \midrule
Checkout & \texttt{checkout scm}, \texttt{git rev-parse HEAD} &
Fetches the pull request's head commit from Gitea into the Jenkins
workspace and prints its full commit ID, so the run can be matched to the
commit in Gitea.\\
Syntax check & \texttt{python3 -m py\_compile pricing.py tests/test\_pricing.py} &
Byte-compiles both files. Passes silently; fails on any Python syntax
error before tests are attempted.\\
Test & \texttt{python3 -m unittest discover -s tests -v} &
Runs both unit tests. Expected output ends with \texttt{Ran 2 tests} and
\texttt{OK}; any failing assertion makes the stage, and the run, fail.\\
\bottomrule
\end{tabularx}
\textbf{What the tests check:} \texttt{test\_total} verifies that ten units
at a price of 10 cost 30, which exercises the multiplication.
\texttt{test\_invalid\_quantity} verifies that a quantity of zero raises
\texttt{ValueError}. Changing the multiplication to an addition, as in the
controlled failure in Section~\ref{sec:ci-failure}, makes
\texttt{test\_total} fail with \texttt{AssertionError: 13 != 30}; this was
confirmed locally before the change was pushed.
The full \texttt{Jenkinsfile}:
\begin{minted}[breaklines]{groovy}
pipeline {
agent any
options {
skipDefaultCheckout()
timeout(time: 10, unit: 'MINUTES')
}
stages {
stage('Checkout') {
steps {
checkout scm
sh 'git rev-parse HEAD'
sh 'python3 --version'
}
}
stage('Syntax check') {
steps {
sh 'python3 -m py_compile pricing.py tests/test_pricing.py'
}
}
stage('Test') {
steps {
sh 'python3 -m unittest discover -s tests -v'
}
}
}
post {
success { echo 'All checks passed.' }
failure { echo 'A stage failed: see the stage view for which one.' }
}
}
\end{minted}
\texttt{skipDefaultCheckout()} prevents Jenkins from checking out the code
twice, so the single explicit \texttt{checkout scm} step is the only checkout
and appears as its own stage. The ten-minute timeout stops a hung build from
holding the executor indefinitely.
\subsection{Dependencies}
The application and tests use only the Python 3 standard library
(\texttt{unittest} and \texttt{py\_compile}), so the pipeline downloads no
packages and has no external dependency source to trust or pin. The only
requirement is a \texttt{python3} interpreter on the Jenkins executor,
installed in the Jenkins container image from \texttt{jenkins/Dockerfile}
(Python 3.13.5, as printed by the Checkout stage); it is not installed in the
Gitea container.
\subsection{Reproducing a Clean Run}
\textbf{Locally:} from the root of a fresh clone of the repository, run the
same commands the pipeline runs:
\begin{verbatim}
python3 -m py_compile pricing.py tests/test_pricing.py
python3 -m unittest discover -s tests -v
\end{verbatim}
(On Windows, use \texttt{python} instead of \texttt{python3}.) A clean result
ends with \texttt{Ran 2 tests} and \texttt{OK}.
\textbf{In Jenkins:} every new commit pushed to a pull request starts a new
run in a fresh checkout of that commit. A team member can also rebuild the
same commit from the pull request's branch page in the Multibranch job.
\subsection{Run Evidence}
Figure~\ref{fig:ci-stage-view} shows a passing run, \texttt{Scrap-Web/PR-13}
run \#2 (October 23, 2026, 9:39 PM), on commit \texttt{b899233}, the head of
pull request \#13 at that time (Figure~\ref{fig:ci-scan-log}). The stage view
reports Checkout, Syntax check, and Test as separate results, each passing,
and the run executed on the built-in node (\emph{Jenkins}). The Checkout
stage's log contains the tested commit ID (\texttt{git rev-parse HEAD}) and
the interpreter version, Python 3.13.5. The run pages of pull request \#13
were later removed by Jenkins when the pull request closed
(Section~\ref{sec:ci-trigger}); their results remain as commit statuses in
Gitea.
\begin{figure}[H]
\centering
\includegraphics[width=\linewidth]{HW6 images/9.2.png}
\caption{October 23, 2026 --- Jenkins stage view of \texttt{Scrap-Web/PR-13}
run \#2 on commit \texttt{b899233}: Checkout, Syntax check, and Test
passed, and the Checkout stage reports Python 3.13.5.}
\label{fig:ci-stage-view}
\end{figure}
\section{Required Merge Gate}
\label{sec:ci-gate}
\subsection{Branch Protection on \texttt{main}}
The default branch, \texttt{main}, is protected in
Gitea~\cite{GiteaProtectedBranches}
(\emph{Scrap-Web $\rightarrow$ Settings $\rightarrow$ Branches},
Figure~\ref{fig:ci-branch-rule}). The rule was created on October 18, 2026,
and the required status check was added on October 23, 2026, once Jenkins
had reported its first status.
\begin{tabularx}{\linewidth}{L{4.6cm}Y}
\toprule
\textbf{Setting} & \textbf{Value and purpose}\\ \midrule
Protected branch & \texttt{main}\\
Direct pushes & Disabled. Every change reaches \texttt{main} through a pull
request, so it passes the same check and review.\\
Required approvals & 1. A teammate other than the author must approve;
Gitea does not allow authors to approve their own pull requests.\\
Dismiss stale approvals & Enabled. A new commit pushed to the pull request
clears earlier approvals, so the final head commit is the one that is
reviewed. This was observed during the demonstration: Gitea automatically
dismissed an earlier approval when commit \texttt{a5180ad} was pushed
(Figure~\ref{fig:ci-pr-fail-fix}).\\
Status check & Enabled. Required context:
\texttt{Scrap-Web/pipeline/pr-main}\\
\bottomrule
\end{tabularx}
The required context was copied from the status Jenkins actually reported on
pull request \#13, not typed in advance. Gitea will not save a status-check
requirement without a pattern, and a pattern that does not match the
reported context exactly leaves the check permanently ``missing'' and blocks
every merge (Section~\ref{sec:ci-trigger}).
\begin{figure}[H]
\centering
\includegraphics[width=0.75\linewidth]{HW6 images/branch-rule.png}
\caption{October 18, 2026 --- Branch protection rule for \texttt{main} in
the Scrap-Web branch settings.}
\label{fig:ci-branch-rule}
\end{figure}
\subsection{How the Status Reaches Gitea}
The merge gate depends on a commit status, not on a trigger. A webhook or
repository scan only tells Jenkins that something changed; it says nothing
about whether the code passes. The sequence is:
\begin{enumerate}
\item A push to a pull request's branch is detected by the Multibranch job's
repository scan (Section~\ref{sec:ci-trigger-config}).
\item The job builds the pull request's latest head commit and runs the
\texttt{Jenkinsfile} stages.
\item When the run starts and again when it finishes, the Jenkins Gitea
plugin~\cite{JenkinsGiteaPlugin} calls the Gitea API with the
\texttt{jenkins-ci} account's token and sets a commit status on that
exact commit: \emph{pending}, then \emph{success} or \emph{failure},
under the context \texttt{Scrap-Web/pipeline/pr-main}.
\item Gitea's branch protection evaluates the statuses on the pull
request's \emph{latest} head commit. The merge is allowed only if that
context is \emph{success} there and the required approval has been
given. A missing, pending, or failed status blocks the merge.
\end{enumerate}
Because the status is attached to a commit, every corrective push creates a
new head commit that has no status until Jenkins tests it again. An earlier
green result cannot be reused for new code.
\subsection{Failed Check Blocks the Merge}
\begin{figure}[H]
\centering
\includegraphics[width=0.8\linewidth]{HW6 images/pr13-fail-fix.png}
\caption{October 23, 2026 --- Pull request \#13 timeline: commit
\texttt{a5180ad} with the failed required check
\texttt{Scrap-Web/pipeline/pr-main} ($\times$), the earlier approval
dismissed automatically, and repair commit \texttt{84a44f0} with the
passing check ($\checkmark$).}
\label{fig:ci-pr-fail-fix}
\end{figure}
\textbf{Links:}
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}{pull request \#13};
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{its
commit list}, where commit \texttt{a5180ad} carries the \emph{failure} status
from Jenkins run \#8. The Jenkins run page itself was removed when the pull
request closed (Section~\ref{sec:ci-trigger}).
\textbf{Expected:} the \texttt{Test} stage fails on commit \texttt{a5180ad},
Jenkins reports \emph{failure}, and Gitea refuses the merge.
\textbf{Actual:} Jenkins run \#8 passed Checkout and Syntax check and
failed at Test with \texttt{AssertionError: 13 != 30}
(Figure~\ref{fig:ci-runs}); the required check on \texttt{a5180ad} was marked
failed (Figure~\ref{fig:ci-pr-fail-fix}), and the pull request could not be
merged while that commit was the head.
\subsection{Passing Check Permits Review and Merge}
\begin{figure}[H]
\centering
\includegraphics[width=0.8\linewidth]{HW6 images/pr13-approved.png}
\caption{October 23, 2026 --- Pull request \#13 at repair commit
\texttt{84a44f0}: required check \texttt{Scrap-Web/pipeline/pr-main}
passed, approved by \texttt{kholmes}, and mergeable.}
\label{fig:ci-merge-allowed}
\end{figure}
\textbf{Links:}
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}{pull request \#13};
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{its
commit list}, where commit \texttt{84a44f0} carries the \emph{success}
status from Jenkins run \#9.
\textbf{Expected:} all three stages pass on commit \texttt{84a44f0}, the
required check turns green, and the merge becomes available once the
required approval is given. \textbf{Actual:} as expected. The check passed,
\texttt{kholmes} approved the final commit, Gitea reported ``All checks were
successful'' and ``This pull request can be merged automatically''
(Figure~\ref{fig:ci-merge-allowed}), and the pull request was merged
(Section~\ref{sec:ci-failure}).
\section{Failure, Repair, and Review}
\label{sec:ci-failure}
\begin{description}
\item[Issue:] \#11,
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/issues/11}
\item[Pull request:] \#13, from \texttt{feature/issue-11} into
\texttt{main}, with \texttt{Closes \#11} in its description:
\url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13}
\item[Required check:] \texttt{Scrap-Web/pipeline/pr-main}
\end{description}
The controlled failure followed the assignment's example: the multiplication
in \texttt{total\_price} was replaced with an addition on the pull request's
branch, which must make \texttt{test\_total} fail (it expects
$10 \times 3 = 30$ but receives $10 + 3 = 13$). The failure was confirmed
locally before each push. Only the feature branch was changed; the deployed
Gitea and Jenkins services were not touched.
\subsection{Dated Sequence}
All times are October 23, 2026, Eastern Time. Each commit ID below matches
the commit shown in
\href{https://git.ssw590-08.me/SSW-590-08/Scrap-Web/pulls/13/commits}{pull
request \#13's commit list}, where each commit still carries the status its
Jenkins run reported. Figure~\ref{fig:ci-runs} shows the complete run
history of the \texttt{PR-13} job, captured before Jenkins removed the job
when the pull request closed (Section~\ref{sec:ci-trigger}).
\begin{tabularx}{\linewidth}{L{1.5cm}L{3.3cm}L{1.7cm}L{1.0cm}Y}
\toprule
\textbf{Time} & \textbf{Step} & \textbf{Commit} & \textbf{Run} &
\textbf{Result}\\ \midrule
9:39 PM & First run after Python was installed & \texttt{b899233} & \#2 &
All stages passed\\
11:05 PM & Failing commit pushed (addition) & \texttt{a5180ad} & \#8 &
Test stage failed; check \emph{failure}; merge blocked\\
11:07 PM & Repair commit pushed (multiplication restored) &
\texttt{84a44f0} & \#9 &
All stages passed; check \emph{success}\\
11:10 PM & Peer review & \texttt{84a44f0} & --- &
Approved by \texttt{kholmes}\\
11:12 PM & Merge into \texttt{main} & \texttt{1de58d4} (merge) & --- &
Merged; issue \#11 closed automatically\\
\bottomrule
\end{tabularx}
\begin{figure}[H]
\centering
\includegraphics[width=0.75\linewidth]{HW6 images/pr13-runs.png}
\caption{October 23, 2026 --- Run history of Jenkins job
\texttt{Scrap-Web/PR-13}: run \#1 failed at Checkout (no Python), runs
\#3 and \#8 failed at Test (controlled failures), and runs \#2, \#4, \#6,
\#7, and \#9 passed.}
\label{fig:ci-runs}
\end{figure}
\subsection{Expected Versus Actual Results}
\begin{tabularx}{\linewidth}{L{3.4cm}YY}
\toprule
\textbf{Step} & \textbf{Expected} & \textbf{Actual}\\ \midrule
Failing commit & Syntax check passes; Test fails on
\texttt{test\_total}; check reports \emph{failure} &
As expected: \texttt{AssertionError: 13 != 30} in run \#8\\
Merge attempt & Blocked while the required check fails &
Blocked\\
Repair commit & All three stages pass; check reports \emph{success} &
As expected in run \#9\\
Review & The earlier approval is cleared by the new commits; a fresh
approval is required on the final commit &
Earlier approval dismissed automatically; \texttt{kholmes} approved
\texttt{84a44f0} at 11:10 PM\\
Merge & Allowed only after the passing check and one approval &
Merged at 11:12 PM as \texttt{1de58d4}\\
\bottomrule
\end{tabularx}
\subsection{Earlier Attempt and Corrective Action}
A first failure-and-repair attempt was made earlier the same evening: failing
commit \texttt{ab0bcc2} (run \#3, failed at Test) and repair commit
\texttt{81c343d} (run \#4, passed). While it was in progress, a separate
\texttt{Jenkinsfile} was merged into \texttt{main} through pull request
\#15, so pull request \#13 also showed a merge conflict, and a blocked merge
could not demonstrate the status check alone. The conflict was resolved by
merging \texttt{main} into the branch and keeping the tested
\texttt{Jenkinsfile} (commit \texttt{c5538a8}, run \#6), and stray files
committed by mistake were removed (run \#7). The cycle was then repeated on a
conflict-free branch, producing the sequence above, in which the failed
check is the only reason the merge was blocked.
\section{Credentials and Build Boundary}
\label{sec:ci-credentials}
\subsection{Secret Storage and Scope}
No token or password appears in the repository, the \texttt{Jenkinsfile},
the Compose file, a console log, or this manual. Values are stored only where
listed below; this report names them but never reproduces them.
\begin{tabularx}{\linewidth}{L{3.4cm}L{4.0cm}Y}
\toprule
\textbf{Secret} & \textbf{Stored in} & \textbf{Scope}\\ \midrule
Gitea integration token & Jenkins credential store, global scope, ID
\texttt{gitea-jenkins-ci} (Figure~\ref{fig:ci-credential}) & Belongs to
the dedicated, restricted account \texttt{jenkins-ci}, which is a Write
collaborator on Scrap-Web only. Permissions: \texttt{write:repository} and
\texttt{read:user} (Figure~\ref{fig:ci-token}), enough to read the
repository and set commit statuses.\\
\texttt{jenkins-ci} password & Not stored; used once to create the token &
Hint only in the Passwords table.\\
Jenkins administrator passwords & Jenkins user database (stored hashed) &
One named account per team member; hints only in the Passwords table.\\
\bottomrule
\end{tabularx}
\begin{figure}[H]
\centering
\includegraphics[width=0.7\linewidth]{HW6 images/jenkins-credential.png}
\caption{October 23, 2026 --- The \texttt{gitea-jenkins-ci} credential in
Jenkins 2.580.1. The token is shown only as ``Concealed''.}
\label{fig:ci-credential}
\end{figure}
The pipeline itself uses no secrets: the \texttt{Jenkinsfile} contains no
\texttt{withCredentials} block, and \texttt{checkout scm} uses the job's
configured repository credential automatically without exposing its value to
build steps. A build therefore has nothing secret to print or exfiltrate
through its own steps. If the token is ever exposed, it is revoked in Gitea
(\texttt{jenkins-ci} $\rightarrow$ Settings $\rightarrow$ Applications), a
new one is generated, and the Jenkins credential is updated.
\subsection{Who Can Change What Jenkins Runs}
The \texttt{Jenkinsfile} is code that Jenkins executes, so editing it is
equivalent to running commands on the build host. Only the two team members
can change Scrap-Web: \texttt{samahk13}, the repository owner, and
\texttt{kholmes}, a Write collaborator (Figure~\ref{fig:ci-collaborators}).
The only other account with Write access is \texttt{jenkins-ci}, which
Jenkins uses to read code and post statuses. Because \texttt{main} is
protected (Section~\ref{sec:ci-gate}), a change to the \texttt{Jenkinsfile}
reaches \texttt{main} only through a pull request that passes the check and
is approved by the other team member.
A Multibranch Pipeline builds a pull request using the \texttt{Jenkinsfile}
from that pull request's branch. For pull requests from forks, which could
come from someone outside the team, the job's trust setting is
\emph{Nobody} (Figure~\ref{fig:ci-branch-source}), so Jenkins builds them
with the trusted \texttt{Jenkinsfile} from \texttt{main} rather than the
fork's version. An untrusted contributor therefore cannot make Jenkins run a
modified pipeline on the build host.
\subsection{Where Builds Execute and the Risk}
Builds run on the Jenkins controller's own executor (the built-in node),
inside the Jenkins container; there is no separate build agent. This is
permitted for this assignment~\cite{JenkinsSecurity}, but it carries a
specific risk: build steps run in the same container as Jenkins itself, so a
malicious pipeline could read \texttt{/var/jenkins\_home}, including stored
credentials and job configuration. The compensating restrictions are:
\begin{itemize}
\item only the two team members can author pipeline changes, and
\texttt{main} requires a passing check and review;
\item untrusted fork pull requests cannot replace the \texttt{Jenkinsfile}
and receive no credentials;
\item the Docker socket is not mounted into the Jenkins container: the
Compose file (Section~\ref{sec:ci-deploy}) mounts only the
\texttt{jenkins\_home} volume, so a build cannot control other
containers or the Droplet;
\item the Jenkins web interface is reachable only over HTTPS through Caddy
and requires login (Section~\ref{sec:ci-https}).
\end{itemize}
\subsection{Plugin-Update Check}
On \textit{[date]}, \emph{Manage Jenkins $\rightarrow$ Plugins $\rightarrow$
Updates} listed \textit{[n]} available updates \textit{[name any marked as
security fixes]}. Action taken: \textit{[updated and restarted Jenkins /
deferred until after the assignment, with reason]}. Plugin updates are
checked before each assignment, and any plugin with a published security
warning is updated first.
\subsection{Troubleshooting a Failed Trigger or Build}
\label{sec:ci-troubleshoot}
\textbf{The pull request shows no Jenkins status at all:}
\begin{enumerate}
\item In Jenkins, open the Scrap-Web job's \emph{Scan Repository Log} and
check that the pull request was discovered. Run \emph{Scan Repository
Now} to discover it immediately instead of waiting for the next
one-minute scan.
\item If the scan cannot list the repository, check that the
\texttt{gitea-jenkins-ci} credential holds a current token and that
\texttt{jenkins-ci} is still a Write collaborator
(Section~\ref{sec:ci-trigger}).
\item If a webhook is used: in Gitea, open \emph{Scrap-Web $\rightarrow$
Settings $\rightarrow$ Webhooks}, check \emph{Recent Deliveries} for the
response code, and use \emph{Test Delivery} after any fix.
\end{enumerate}
\textbf{A run exists but failed:}
\begin{enumerate}
\item Open the run's stage view to see which stage failed, then its
console output; the first error message is the one to fix.
\item Checkout fails: check the integration credential and that Jenkins
can reach Gitea. Syntax check or Test fails: reproduce locally with the
commands in Section~\ref{sec:ci-pipeline}.
\item \texttt{python3: not found}: Python is missing from the Jenkins
container. This is a deployment problem, not a code problem.
\item The check is green but Gitea reports it as missing: the branch
rule's status-check pattern does not exactly match
\texttt{Scrap-Web/pipeline/pr-main}; correct the pattern.
\item Runs of a closed pull request have disappeared: the Multibranch
job removed them as orphaned items. Set \emph{Orphaned Item Strategy}
to keep old items (30 days here) and rely on the commit statuses in Gitea
for runs that were already removed.
\item Fix the cause with a new commit on the same branch. The push starts a
new run and a new status on the new head commit. Never weaken the tests
or bypass branch protection to make a merge possible.
\end{enumerate}
\section{Manual Quality and Controls}
\textit{[Version and history entry, Hosts and Passwords table updates, UML
deployment diagram, citations, glossary and index entries, and the operator
restart/troubleshooting note.]}
+228
View File
@@ -0,0 +1,228 @@
\chapter{Digital Ocean Docker Deployment}
\ChapterLabel{Digital Ocean}
\section{Overview}
This chapter documents the deployment of the Dockerized website to a
DigitalOcean Droplet. The DigitalOcean Droplet was configured as an Ubuntu
Linux server and was accessed remotely using SSH. Docker was then installed
and configured on the Droplet so that the website could run inside a Docker
container.
The deployment process consisted of creating the DigitalOcean Droplet,
connecting to the Droplet through SSH, updating the Ubuntu operating system,
installing Docker, transferring the website project to the server, building
the Docker image, running the Docker container, configuring the firewall, and
accessing the deployed website through the Droplet's public IP address.
DigitalOcean Droplets are Linux-based virtual machines that can be used to
host websites and other applications. The DigitalOcean documentation
recommends using SSH keys for secure access to Droplets
\section{Create the DigitalOcean Droplet}
A DigitalOcean Droplet was created through the DigitalOcean Control Panel.
The Droplet was configured with an Ubuntu operating system and a suitable
shared CPU plan for the website deployment.
After the Droplet was created, DigitalOcean provided a public IPv4 address.
This address was used to remotely access the server and later to access the
deployed website.
The public IPv4 address of the deployed Droplet is:
\begin{center}
\textbf{137.184.211.98}
\end{center}
\section{Connect to the Droplet Using SSH}
After creating the Droplet, an SSH connection was established from the local
Mac terminal. The following command was used to connect to the remote Ubuntu
server:
\begin{minted}{bash}
ssh root@137.184.211.98
\end{minted}
After successfully connecting, the terminal displayed the Ubuntu server
prompt. This confirmed that commands entered in the terminal were being
executed on the DigitalOcean Droplet rather than on the local computer.
\section{Update the Ubuntu Server}
The Ubuntu package repository was updated before installing the software
required for the deployment. The following command was executed:
\begin{minted}{bash}
apt update
\end{minted}
The installed packages were then upgraded using:
\begin{minted}{bash}
apt upgrade -y
\end{minted}
\section{Install and Verify Docker}
Docker was installed directly on the DigitalOcean Ubuntu Droplet. The
following command was used:
\begin{minted}{bash}
apt install docker.io -y
\end{minted}
Docker was then configured to start automatically when the server starts:
\begin{minted}{bash}
systemctl enable docker
\end{minted}
The Docker service was started with:
\begin{minted}{bash}
systemctl start docker
\end{minted}
The Docker installation was verified using:
\begin{minted}{bash}
docker --version
\end{minted}
The Docker service status was also checked using:
\begin{minted}{bash}
systemctl status docker
\end{minted}
\section{Transfer the Website to the Droplet}
The website source code was transferred to the DigitalOcean Droplet. The
application contained the Dockerfile and the source files required to build
and run the website.
The project directory on the Droplet contained the Dockerfile used to create
the Docker image.
The project was then accessed from the terminal using:
\begin{minted}{bash}
cd digital-ocean-docker
\end{minted}
\section{Build the Docker Image}
After entering the project directory, a Docker image was created using the
following command:
\begin{minted}{bash}
docker build -t digital-ocean-docker .
\end{minted}
The \texttt{-t} option assigns the image the name
\texttt{digital-ocean-docker}. The period at the end of the command specifies that the
current directory is used as the Docker build context.
The resulting Docker image was verified with:
\begin{minted}{bash}
docker images
\end{minted}
\section{Run the Docker Container}
The Docker container was started using the following command:
\begin{minted}{bash}
docker run -d \
--restart unless-stopped \
-p 80:3000 \
--name digital-ocean-docker \
digital-ocean-docker
\end{minted}
The port mapping was configured as:
\begin{center}
\texttt{80:3000}
\end{center}
This maps port 80 on the DigitalOcean Droplet to port 3000 inside the
Docker container. Since the Express application runs on port 3000, requests
received by the Droplet on port 80 are forwarded to the application inside
the Docker container.
The \texttt{docker ps} command was used to verify that the container was
running:
\begin{minted}{bash}
docker ps
\end{minted}
The expected port mapping appeared similar to:
\begin{minted}{text}
0.0.0.0:80->3000/tcp
\end{minted}
This confirmed that the website was exposed through port 80 of the
DigitalOcean Droplet.
\section{Configure the Firewall}
The Ubuntu firewall was configured to allow SSH, HTTP, and HTTPS traffic.
OpenSSH uses port 22 for the SSH connection to the server.
The following commands were used:
\begin{minted}{bash}
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
\end{minted}
The firewall was then enabled:
\begin{minted}{bash}
ufw enable
\end{minted}
The firewall configuration was verified with:
\begin{minted}{bash}
ufw status
\end{minted}
The firewall configuration allowed the following traffic:
\begin{itemize}
\item Port 22 -- SSH/OpenSSH access to the Droplet.
\item Port 80 -- HTTP access to the deployed website.
\item Port 443 -- HTTPS access for secure web traffic.
\end{itemize}
Port 22 was allowed before enabling the firewall so that the existing SSH
connection to the Droplet would remain accessible.
\section{Access the Deployed Website}
After the Docker container was started and port 80 was exposed, the deployed
website was accessed through the public IPv4 address assigned to the
DigitalOcean Droplet.
The website can be accessed at:
\begin{center}
\url{http://137.184.211.98}
\end{center}
The public website link is also provided below:
\begin{center}
\href{http://137.184.211.98}{\textbf{DigitalOcean Deployed Website}}
\end{center}
The browser request is sent to the Droplet on port 80 and is forwarded to
port 3000 inside the Docker container.
+142
View File
@@ -0,0 +1,142 @@
\chapter{Document Authoring Guide}
\ChapterLabel{DocumentGuide}
\index{LaTeX}
\index{document conventions}
\index{Appendix!Document Authoring Guide}
\section{How to Use This Appendix}
Use this appendix to maintain the template's file conventions, build process,
and review rules. Update it when the document structure or toolchain changes.
\section{Template Provenance}
This template was developed by \textbf{Darian Muresan, Ph.D.}, in conjunction
with \textbf{OpenAI Codex} and \textbf{Anthropic Claude Code}. Keep this
attribution distinct from the assignment-specific instructor metadata.
\section{File Naming and Responsibilities}
Every chapter file shall use the \texttt{devops} prefix, a PascalCase chapter
name, and the \texttt{.tex} suffix. Each such file shall contain one complete
chapter, beginning with \texttt{\string\chapter\{...\}}, and all of its
sections and subsections. Do not split one chapter into section-level
\texttt{.tex} files. For example, all of Chapter~2 is contained in
\path{devopsExampleAssignment.tex}. Do not add requirements or
architecture-design chapters; this template records a DevOps learning activity
and its operational evidence.
\section{Synonyms and Controlled Terms}
\index{synonyms}
Use one preferred term for each important concept. If an assignment uses
equivalent terms, record them here before release. For example, state whether
``continuous delivery'' refers to \gls{cd} generally or specifically excludes
automatic production deployment. Add important terms to
\texttt{devopsGlossary.tex} and index them where used.
\section{Building the PDF}
The template requires a LaTeX distribution with \texttt{pdflatex},
\texttt{bibtex}, \texttt{makeglossaries}, and \texttt{makeindex}.
Install the tools using the platform instructions below, then run one of the
following platform builds.
\subsection{macOS and Linux Build}
\begin{verbatim}
make -f makefileMacLinux pdf
\end{verbatim}
\subsection{Windows PowerShell Build}
\begin{verbatim}
.\makefilePowerShell.ps1 -Action pdf
\end{verbatim}
The completed build regenerates references, bibliography, glossary, and index.
Review the log and visually inspect affected PDF pages. Do not edit generated
auxiliary files or the PDF directly.
\section{Install LaTeX Tools on macOS}
\index{macOS}
\index{MacTeX}
\subsection{Recommended Installation}
Install the current full \href{https://www.tug.org/mactex/}{MacTeX}
distribution. It includes TeX Live, \texttt{pdflatex}, \texttt{bibtex},
\texttt{latexmk}, \texttt{makeglossaries}, \texttt{makeindex}, and useful
applications such as TeXShop and TeX Live Utility. The full distribution is the
least troublesome choice for this template because it includes the packages
used by the glossary, table, listing, color, and hyperlink features.
Either download the signed installer from the MacTeX web site and complete the
macOS installation dialog, or, if Homebrew is already installed, run:
\begin{verbatim}
brew install --cask mactex
\end{verbatim}
Close and reopen Terminal after installation. If the TeX commands are not
found, add the MacTeX binary directory to the current shell session:
\begin{verbatim}
export PATH="/Library/TeX/texbin:$PATH"
\end{verbatim}
Do not place this command in a shell profile until it has been verified on the
local computer.
\subsection{Verification and Compilation}
From the template directory, verify the tools:
\begin{verbatim}
command -v pdflatex bibtex latexmk makeglossaries makeindex
\end{verbatim}
Each command should print a path. Then create the PDF:
\begin{verbatim}
make -f makefileMacLinux pdf
\end{verbatim}
To remove generated intermediate files while keeping the PDF, run:
\begin{verbatim}
make -f makefileMacLinux clean
\end{verbatim}
\section{Install LaTeX Tools on Windows}
\index{Windows}
\index{MiKTeX}
\subsection{Recommended Installation}
Install the current Basic MiKTeX distribution using the official
\href{https://miktex.org/howto/install-miktex}{MiKTeX Windows installation
guide}. During installation, choose a per-user installation when appropriate
and set missing-package installation to \emph{Ask me first} or \emph{Yes}.
The latter is convenient for a student machine with Internet access; the former
makes each package installation explicit.
Open MiKTeX Console after installation, apply available updates, and install
the \texttt{latexmk} package if the verification command below cannot find it.
On an organization-managed computer, obtain approval before installing software
or changing execution policy.
\subsection{Verification and Compilation}
Open a new PowerShell window in the template directory and verify:
\begin{verbatim}
Get-Command pdflatex,bibtex,latexmk,makeglossaries,makeindex
\end{verbatim}
Each command should display a command record. Build the PDF with:
\begin{verbatim}
.\makefilePowerShell.ps1 -Action pdf
\end{verbatim}
If PowerShell blocks the script under a managed execution policy, ask the
system administrator for the approved procedure. Do not bypass institutional
security policy. To remove intermediate build files, run:
\begin{verbatim}
.\makefilePowerShell.ps1 -Action clean
\end{verbatim}
\section{Common Build Problems}
\begin{tabularx}{\linewidth}{L{3.0cm}Y}
\toprule \textbf{Symptom} & \textbf{Resolution}\\ \midrule
Command not found & Close and reopen the terminal. On macOS, verify the TeX
binary path; on Windows, verify MiKTeX completed installation and is on the user PATH.\\
Missing LaTeX package & Use MiKTeX Console or its approved on-the-fly package
installation prompt on Windows. On macOS, install the full MacTeX distribution
or use TeX Live Utility to add the missing package.\\
References or glossary incomplete & Run the supplied platform build instead of
a single \texttt{pdflatex} command; it runs BibTeX, the glossary tool, and the
index tool in the required order.\\
Script is blocked & Follow the institution's approved PowerShell policy or run
the documented build commands with an approved administrator.\\ \bottomrule
\end{tabularx}
\section{Authoring and Review Rules}
Replace bracketed placeholders with assignment facts. Keep operational examples
safe, bounded, and free of credentials. Link activities to evidence, retain
history, and state unknowns or instructor decisions explicitly. Rebuild after
structural, cross-reference, table, glossary, or index changes.
+19
View File
@@ -0,0 +1,19 @@
\chapter*{Document History}
\addcontentsline{toc}{chapter}{Document History}
\index{document history}
\begin{table}[H]
\caption{Document Update History\label{Table:DocumentHistory}}
\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
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 10, 2026 / 1.4 & SK, KH & Completed the related Gitea automation in LaTeX exercise and documented it in new chapter & \ChapterRef{AutomatedManualBuild} \\
October 2, 2026 / 1.3 & SK, KH & Completed the Gitea startup exercise and documented the process. Also, created the hosts and passwords tables to be used throughout the group assignments & \ChapterRef{JenkinsCI}, \ChapterRef{PWDHST} \\
September 24, 2026 / 1.2 & SK, KH& Completed the Digital Ocean Docker Deployment chapter; the class-based JavaScript refactor of the two-button website with its accompanying UML class diagram; the LaTeX Docker chapter ; and the Project Proposal chapter, addressing the two-tool comparison, dashboard, SWOT, and unique-contribution rubric criteria. & \ChapterRef{Digital Ocean}, \ChapterRef{ClassBasedJSRefactor}, \ChapterRef{Latex Docker}, \ChapterRef{ProjectProposal}\\
September 16, 2026 / 1.1 & SK, KH & Completed the Linux Commands assignment: environment setup with terminal printout figure and full solutions to Problem Set sections A--E & \ChapterRef{LinuxCommands} \\
\bottomrule
\end{tabularx}
\end{table}
+18
View File
@@ -0,0 +1,18 @@
\newacronym{ai}{AI}{artificial intelligence}
\newacronym{ci}{CI}{continuous integration}
\newacronym{cd}{CD}{continuous delivery or continuous deployment}
\newacronym{iac}{IaC}{infrastructure as code}
\newacronym{slo}{SLO}{service-level objective}
\newglossaryentry{automation}{name={automation},description={A repeatable, version-controlled procedure executed by software rather than undocumented manual steps}}
\newglossaryentry{deployment}{name={deployment},description={The controlled delivery of a versioned change to an environment}}
\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{rollback}{name={rollback},description={A controlled return to a known acceptable version or state after a failed or harmful change}}
\newglossaryentry{runbook}{name={runbook},description={A documented operational procedure for a repeatable task or incident response}}
\newglossaryentry{synonyms}{name={synonyms},description={Equivalent terms used in this assignment; record preferred terms to avoid ambiguity in instructions and evidence}}
\newglossaryentry{pullrequest}{name={pull request},description={A proposed change from one branch into another, reviewed and checked before it is merged}}
\newglossaryentry{webhook}{name={webhook},description={An HTTP request that Gitea sends to another service, such as Jenkins, when a repository event occurs}}
\newglossaryentry{statuscheck}{name={status check},description={A named pass, fail, or pending result that a CI system attaches to a specific commit}}
\newglossaryentry{mergegate}{name={merge gate},description={A branch-protection rule that blocks a merge until required status checks pass and reviews are approved}}
\newglossaryentry{jenkinsfile}{name={\texttt{Jenkinsfile}},sort={Jenkinsfile},description={The version-controlled file that defines a Jenkins pipeline's stages and steps}}
+47
View File
@@ -0,0 +1,47 @@
\chapter{Introduction}
\ChapterLabel{Introduction}
\index{introduction}
\index{DevOps}
\section{How to Use This Assignment}
Replace bracketed text with approved assignment facts. Delete instructional
examples before release, but retain the stable identifiers, history, glossary,
index, appendices, and evidence structure. This document is an assignment
brief and operational record, not a requirements or software-design document.
\section{Purpose and Learning Objectives}
State the DevOps capability students will practice and the observable learning
outcomes. \textit{Example: Students will provision a minimal Linux service,
automate its deployment, collect operational evidence, and demonstrate a safe
rollback.}
\section{Scope and Constraints}
State the permitted cloud or local environment, team size, required tools,
budget limits, source-control repository, timebox, and prohibited actions.
Do not include credentials, access tokens, student records, or production data.
\section{Deliverables and Due Date}
\begin{tabularx}{\linewidth}{L{3.2cm}Y}
\toprule \textbf{Item} & \textbf{Expectation}\\ \midrule
Due date & \DueDate\\
Repository & \textit{[repository URL or LMS location]}\\
Required deliverables & \textit{[automation, runbook, evidence, reflection]}\\
Team policy & \textit{[individual or team; contribution expectations]}\\ \bottomrule
\end{tabularx}
\section{Using This Template with AI Agents}
\index{AI agent!DevOps workflow}
AI may assist with explanation, drafting, troubleshooting, and reviewing
automation. It does not replace student understanding or authorize an agent to
operate accounts, approve work, invent results, or receive secrets. Before
editing, an AI agent shall read \texttt{devopsAIAgentGuide.tex}, load only the
relevant assignment files, identify assumptions, and preserve evidence
boundaries. Record material AI assistance in \ChapterRef{AIPromptLog}.
\begin{verbatim}
Read devopsAIAgentGuide.tex first. For this SSW 590 assignment, identify the
requested task and read only the listed sources. Use supplied evidence only;
do not invent commands, deployment results, approvals, credentials, or costs.
Preserve stable IDs and history. Make the smallest appropriate change, build
the PDF, and report assumptions, risks, and actions requiring human approval.
\end{verbatim}
+349
View File
@@ -0,0 +1,349 @@
\chapter{Jenkins/CI}
\ChapterLabel{JenkinsCI}
\section{Student Pack domain and DNS}
The team claimed a domain through the Namecheap offer in the GitHub
Student Developer Pack, which provides one \texttt{.me} domain free for
the first year, including an SSL certificate, through the GitHub
Education-linked signup flow.
\begin{description}
\item[Domain offer:] Namecheap, via GitHub Student Developer Pack
(\texttt{education.github.com/pack/offers}).
\item[Eligibility:] requires an approved GitHub Student Developer Pack
account, verified with a Stevens \texttt{.edu} email.
\item[Domain registered:] \texttt{ssw590-08}
\item[First-year cost:] \$0 (covered by the Student Pack offer).
\item[Renewal cost:] \texttt{\$14.16 I believe}
\item[Expiration / renewal date:] \texttt{10/01/2027}
\item[Tracking renewal:] the renewal date is recorded here and in the
team's Hosts table; Namecheap also sends automatic renewal-reminder
emails to the account on file. A future team member should check the
Hosts table entry and the Namecheap account directly rather than
assume the domain renews automatically without payment.
\end{description}
\textbf{Gitea hostname:} \texttt{git.ssw590-08.me} -- chosen as the
subdomain for the team's Gitea instance.
\textbf{DNS configuration:} an A record was created in Namecheap's
Advanced DNS panel for the domain:
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-01 230752.png}
\caption{Namecheap's Advanced DNS panel}
\label{fig:dns}
\end{figure}
\begin{center}
\begin{tabular}{llll}
\toprule
Type & Host & Value & TTL \\
\midrule
A & git & 147.182.179.191 & Automatic \\
\bottomrule
\end{tabular}
\end{center}
\textbf{Independent lookup verification:} resolution of the hostname was
confirmed from a machine independent of the Droplet itself using
\texttt{nslookup git.git.ssw590-08.me}, returning the expected Droplet IP
address.
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-01 230957.png}
\caption{nslookup}
\label{fig:domain}
\end{figure}
\textbf{HTTPS hostname link:} \texttt{https://git.ssw590-08.me/}.
\section{Pinned Gitea Deployment}
Gitea was deployed on the team's DigitalOcean Droplet using Docker
Compose, with a pinned, recorded image version rather than a floating
\texttt{latest} tag.
\begin{description}
\item[Droplet:] Droplet plan/size: RAM 512GB, Disk 10GB; Region: NYC1; OS: Ubuntu 24.04 (LTS) x64; Basic \$4/mo plan
\item[Docker installation:] Docker Engine and the Compose plugin were
installed from Docker's official APT repository (rather than the
Ubuntu-default \texttt{docker.io} package, which does not include
\texttt{docker compose}).
\item[Gitea image:] \texttt{gitea/gitea: 1.26.4 8e25c717b8f7 245MB 69.3MB U}
\item[Restart policy:] \texttt{restart: unless-stopped}, so the
container recovers automatically after a Droplet reboot.
\item[Persistent mount:] a named Docker volume (\texttt{gitea-data})
mounted to \texttt{/data} inside the container -- this is what
survives container replacement, independent of the container's own
disposable filesystem layer.
\item[Proxy connection:] Gitea now sits behind a reverse proxy
terminating HTTPS at \url{https://git.ssw590-08.me/}; the Gitea
backend (port 3000) is no longer directly reachable from the public
internet -- verified by confirming
\texttt{http://147.182.179.191:3000} is no longer publicly
accessible.
\end{description}
\textbf{Redacted Compose excerpt:}
\begin{verbatim}
services:
gitea:
image: gitea/gitea: 1.26.4 8e25c717b8f7 245MB 69.3MB U
container_name: gitea
restart: unless-stopped
environment:
- USER_UID=1000
- USER_GID=1000
# SQLite is Gitea's default database, so no DB-related env vars are
# required here.
- GITEA__server__ROOT_URL=http://[DROPLET_IP]:3000/
# reverse proxy are in place. Gitea uses this value to
# generate links, so it must match how users actually reach the site.
volumes:
- gitea-data:/data
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- "3000:3000" # web UI -- will move behind the reverse proxy later
- "222:22" # git-over-SSH (optional; remove if you won't use it)
volumes:
gitea-data:
# Named volume -- this is what survives "docker compose down/up" and
# is the basis of the persistence test the rubric requires.
\end{verbatim}
\textbf{Reproducing this deployment:} another team could repeat this
installation by provisioning a Droplet with Docker installed, copying
this Compose file, substituting their own hostname/IP into
\texttt{http://147.182.179.191:3000/}, and running \texttt{docker compose up -d}. No
manual configuration file editing is required beyond that substitution.
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-01 233750.png}
\caption{10/01/26 docker compose ps with Gitea container running}
\label{fig:dockercompose}
\end{figure}
\section{Database and Persistence}
The team selected \textbf{SQLite} (Gitea's built-in default database)
rather than a separate PostgreSQL container. This choice was made given
the team's limited prior Docker/Linux experience -- SQLite requires no
separate database service, no database credentials to manage, and no
private network configuration between containers, while still being
explicitly named in the assignment as a reasonable choice for a small
student team.
The SQLite database file resides inside the \texttt{gitea-data} named
volume (under \texttt{/data} in the container), which is mounted outside
the container's disposable filesystem layer -- confirmed by the
persistence test below. No database service or public database port is
exposed, since SQLite requires none.
\textbf{Persistence test:}
\begin{enumerate}
\item Created a test repository and one test issue in Gitea. \\
Repository:SSW-590\; Issue: \#1 Test issue \#1.
\item Ran \texttt{docker compose down}, followed by
\texttt{docker compose up -d}, from the \texttt{\textasciitilde/gitea}
directory containing the Compose file. This destroys and recreates
the Gitea container itself while leaving the named volume untouched.
\item Refreshed the Gitea web interface and confirmed the test
repository and issue were still present and unchanged.
\end{enumerate}
\textbf{Conclusion:} the container replacement did not affect stored
data, confirming that Gitea's application data (repository metadata,
issues, and the SQLite database file) persists independently of the
container lifecycle, as intended by the named-volume configuration.
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-01 222503.png}
\caption{10/01/26 Before docker compose down}
\label{fig:before}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-01 222539.png}
\caption{10/01/26 After docker compose down}
\label{fig:after}
\end{figure}
\section{HTTPS/certificate}
A custom domain, \texttt{git.ssw590-08.me}, was configured
to provide secure access to the Gitea server hosted on
DigitalOcean. A DNS A record was created to point the
domain to the Droplet's public IP address.
Caddy was deployed as a Docker container and configured
as a reverse proxy to forward HTTPS requests to the
Gitea service on the internal Docker network. Caddy
automatically provisions and renews TLS certificates
and redirects HTTP requests to HTTPS.
The Gitea configuration was updated to use
\texttt{https://git.ssw590-08.me/} as its root URL.
The HTTPS configuration was verified by accessing the
Gitea website through a browser, checking the TLS
certificate, and testing the HTTP-to-HTTPS redirect.
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/https-proof.png}
\caption{Showcase of Gitea running on HTTPS}
\label{fig:https}
\end{figure}
There was a major blockage in setting up the HTTPS which was linked back to an issue in setting up the YML file. After reviewing and debugging the config.yml, the HTTPS was able to launch at the needed port.
\section{Firewall/exposure}
The DigitalOcean firewall was configured to allow
inbound TCP traffic on ports 80 and 443 for HTTP
and HTTPS access. Port 222 was retained for Git
SSH access, while port 22 was used for Droplet
administration.
Caddy was configured to expose ports 80 and 443
and act as the public entry point for the Gitea
web interface. The Gitea web port, 3000, was
removed from public port publishing and remained
accessible internally through the Docker network.
The firewall configuration and Docker port mappings
were verified to ensure that web traffic was routed
through Caddy rather than directly to Gitea.
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/docker-running.png}
\caption{Docker showcasing reverse proxy confirmation}
\label{fig:reverse-proxy}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/firewall-ports.png}
\caption{Terminal Showing exposed ports from firewall}
\label{fig:firewall}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/shh-verification.png}
\caption{SSH Key working for Gitea}
\label{fig:ssh}
\end{figure}
For this portion, dealing with the SSH key proved trickier than expected. Gitea and GitHub use different SSH keys and therefore cannot be used in both scenarios. A new SSH key had to be generated for Gitea and connected before firewall connection could be tested.
\section{Startup team workflow}
\begin{description}
\item[Organization:] \url{https://git.ssw590-08.me/SSW-590-08}
\item[Product repository:] \url{https://git.ssw590-08.me/SSW-590-08/Scrap-Web}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 235122.png}
\caption{README.md}
\label{fig:readme}
\end{figure}
\end{description}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 235020.png}
\caption{Issues}
\label{fig:issues1}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 235009.png}
\caption{Issues}
\label{fig:issues2}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 234535.png}
\caption{Issue \#1}
\label{fig:issue-one}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 233510.png}
\caption{Issue \#5}
\label{fig:issue-five}
\end{figure}
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW4 images/Screenshot 2026-10-02 234912.png}
\caption{Team Members}
\label{fig:team}
\end{figure}
\section{Architecture and operation}
\textbf{End-to-end request and data path:} a browser reaches
\url{https://git.ssw590-08.me/}, which resolves to the Droplet and is
received by the reverse proxy on port 443. The proxy terminates HTTPS
and forwards the request internally to the Gitea container on port
3000, which is no longer directly reachable from outside the Droplet.
Gitea reads and writes its application data, including the SQLite
database file, to the \texttt{gitea-data} named Docker volume, mounted
to \texttt{/data} inside the container. Git repository data and Gitea's
internal database share this same persistent volume; neither lives
inside the container's own disposable filesystem layer.
\textbf{Where data lives:} entirely inside the \texttt{gitea-data}
named volume on the Droplet's disk, independent of the Gitea
container's lifecycle. This was directly verified in Section 3's
persistence test: destroying and recreating the container left the
volume, and therefore all repository and database contents, untouched.
\textbf{Public vs.\ private interfaces:} the DigitalOcean Cloud
Firewall allows inbound TCP traffic on four ports: 443 (HTTPS, the
public entry point via Caddy), 80 (HTTP, used for the redirect to
HTTPS), 22 (Droplet administration/SSH), and 222 (Git-over-SSH). Caddy
is configured to expose only ports 80 and 443 and acts as the sole
public entry point for the Gitea web interface. Gitea's own web port,
3000, has been removed from Docker's public port publishing entirely
and is reachable only internally over the Docker network -- it is not
listed in the Cloud Firewall because it is not exposed to the host's
public network interface at all. This was verified by confirming that
web traffic reaches Gitea only through Caddy, not directly on port
3000, and that the firewall rules and Docker port mappings agree with
each other.
\textbf{Restart and troubleshooting:} the operational restart procedure
is: \texttt{cd \textasciitilde/gitea \&\& docker compose down \&\&
docker compose up -d}. The team has run this procedure directly (as
part of the Section 3 persistence test), confirming Gitea comes back up
with all data intact. For troubleshooting, \texttt{docker compose ps}
shows container status, and \texttt{docker compose logs gitea} surfaces
application logs if the container fails to start or behaves
unexpectedly.
\textbf{Persistence test vs.\ backup/restore -- explicitly
distinguished:} the Section 3 test confirms data survives
\emph{container replacement on the same Droplet, using the same
volume}. It does not prove data could be recovered if that volume, or
the Droplet itself, were lost -- that would require a separate copy of
the data stored elsewhere (a true backup), which has not been performed
and is not required by this assignment's base rubric (it is covered
instead by the optional extra-credit backup/restore task, not attempted
here).
\begin{figure}[H]
\centering
\includegraphics[width=0.8\linewidth]{HW4 images/gitea-architecture-diagram.png}
\caption{Architecture Diagram}
\label{fig:arch}
\end{figure}
+129
View File
@@ -0,0 +1,129 @@
\chapter{Latex Docker}
\ChapterLabel{Latex Docker}
\section{Goal}
Overleaf compiles \texttt{.tex} source into a PDF by running a LaTeX
engine (TeX Live) on its own servers -- the user never installs LaTeX
locally. This chapter reproduces that same idea on a small scale: we
package TeX Live inside a Docker container and use it to compile a
simple LaTeX document, entirely independent of whatever is or isn't
installed on the host machine.
\section{Project Files}
Two files are needed: the LaTeX source to compile, and the
\texttt{Dockerfile} that builds the container.
\subsection{The LaTeX Source (\texttt{hello.tex})}
\begin{minted}{latex}
\documentclass{article}
\title{Hello from a Container}
\author{DevOps Team}
\date{\today}
\begin{document}
\maketitle
This tiny document was compiled entirely inside a Docker container running
TeX Live, with no LaTeX installation on the host machine at all.
\section{Why this matters}
Overleaf itself works the same way behind the scenes: your .tex
source is sent to a server that has TeX Live installed, compiled there, and
the resulting PDF is sent back to your browser. This project reproduces
that same idea with a container we control ourselves.
\end{document}
\end{minted}
\subsection{The Dockerfile}
\begin{minted}{docker}
# Base image: official TeX Live distribution.
# This is the same LaTeX engine Overleaf runs on its own servers.
FROM texlive/texlive:latest
# Working directory inside the container.
WORKDIR /doc
# Copy our LaTeX source file into the container.
COPY hello.tex .
# Compile the document to PDF when the container runs.
# -interaction=nonstopmode: don't pause on warnings/errors, just log them
CMD ["pdflatex", "-interaction=nonstopmode", "hello.tex"]
\end{minted}
\texttt{texlive/texlive} is the official, full TeX Live image -- it is
large (several GB) but guarantees every package and font Overleaf itself
would have available, which matches the goal of this chapter (reproducing
what Overleaf does) more closely than a stripped-down image would.
\section{Building the Image}
From the directory containing both files:
\begin{minted}{bash}
$ docker build -t latex-docker .
\end{minted}
\begin{minted}{text}
[+] Building 42.1s (8/8) FINISHED
=> [1/3] FROM docker.io/texlive/texlive:latest
=> [2/3] WORKDIR /doc
=> [3/3] COPY hello.tex .
=> exporting to image
=> => naming to docker.io/library/latex-docker
\end{minted}
Docker downloads the TeX Live base image (first build only -- cached on
subsequent builds), then layers our working directory and source file on
top, and tags the result as \texttt{latex-docker}.
\section{Running the Container and Retrieving the PDF}
The container compiles the PDF \emph{inside} its own filesystem. To get
the resulting PDF back onto the host machine, we mount our project
directory -- the same one containing \texttt{hello.tex} -- into the
container at the path the \texttt{Dockerfile} uses as its working
directory:
\begin{minted}{bash}
$ docker run --rm -v "$(pwd):/doc" latex-docker
\end{minted}
\begin{minted}{text}
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023)
entering extended mode
(./hello.tex
LaTeX2e <2023-11-01>
...
Output written on hello.pdf (1 page, 59343 bytes).
Transcript written on hello.log.
\end{minted}
\texttt{--rm} removes the container after it exits (we don't need to keep
it around once the PDF exists); \texttt{-v "\$(pwd):/doc"} mounts our
current host directory to \texttt{/doc} inside the container, which is the
same path the \texttt{Dockerfile} set as its working directory.
Because the mounted directory is the same one on the host, the compiled
files appear right there once the container exits:
\begin{minted}{bash}
$ ls
\end{minted}
\begin{minted}{text}
Dockerfile hello.aux hello.log hello.pdf hello.tex
\end{minted}
\section{Verifying the Output}
Opening \texttt{output/hello.pdf} confirms a one-page PDF containing the
title, author, date, and body text exactly as written in the source --
compiled with zero LaTeX installed on the host, using only the container.
\section{Relation to Overleaf}
\begin{itemize}
\item Overleaf's compile servers are, conceptually, exactly this: a
TeX Live environment that takes \texttt{.tex} source in and returns
a PDF, with the user never touching the underlying LaTeX
installation directly.
\item The \texttt{FROM texlive/texlive:latest} base image in our
\texttt{Dockerfile} is functionally the same TeX Live distribution
Overleaf itself is built on.
\item Packaging this as a container means the exact same compile
environment can be reproduced on any machine with Docker installed
-- the core value proposition of containerization applied to a
document-compilation tool instead of a web application.
\end{itemize}
+503
View File
@@ -0,0 +1,503 @@
\chapter{Linux Commands}
\ChapterLabel{LinuxCommands}
\section{Environment Setup}
All commands below were run after creating a scratch directory:
\begin{figure}[H]
\centering
\includegraphics[width=1\linewidth]{HW2 images/Screenshot 2026-09-15 165357.png}
\caption{Env Setup/Commands}
\label{fig:env}
\end{figure}
\section{Problem Set Answers}
\subsection{A) Navigation \& File Ops}
\subsubsection{1. Show your present working directory path only}
\textbf{Input:}
\begin{verbatim}
$ pwd
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
/home/samahk13/lx-test
\end{verbatim}
\subsubsection{2. List all entries, one per line, including dotfiles}
\textbf{Input:}
\begin{verbatim}
$ ls -a1
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
.
..
archive
blob.bin
link-to-file1
old.txt
people.csv
src
sys.log
tmp
words.txt
\end{verbatim}
\subsubsection{3. Copy \texttt{src/file1.txt} to \texttt{tmp/} only if \texttt{tmp} exists, verbosely}
\textbf{Input:}
\begin{verbatim}
$ [ -d tmp ] && cp -v src/file1.txt tmp/
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
'src/file1.txt' -> 'tmp/file1.txt'
\end{verbatim}
\subsubsection{4. Move \texttt{old.txt} into \texttt{archive/}, keeping its original timestamp}
\textbf{Input:}
\begin{verbatim}
$ stat -c '%y %n' old.txt
$ mv old.txt archive/
$ stat -c '%y %n' archive/old.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
2024-01-02 03:04:00.000000000 +0000 old.txt
2024-01-02 03:04:00.000000000 +0000 archive/old.txt
\end{verbatim}
\subsubsection{5. Create an empty \texttt{notes.md} only if it doesn't already exist}
\textbf{Input:}
\begin{verbatim}
$ [ -e notes.md ] || touch notes.md
$ ls -l notes.md
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
-rw-rw-r--. 1 samahk13 samahk13 0 Sep 16 18:30 notes.md
\end{verbatim}
\subsubsection{6. Show human-readable disk usage for \texttt{src} only (not total FS)}
\textbf{Input:}
\begin{verbatim}
$ du -sh src
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
8.0K src
\end{verbatim}
\subsection{B) Viewing \& Searching}
\subsubsection{7. Print line numbers while displaying \texttt{sys.log}}
\textbf{Input:}
\begin{verbatim}
$ cat -n sys.log
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
1 INFO boot ok
2 WARN disk low
3 ERROR fan fail
4 INFO shutdown
\end{verbatim}
\subsubsection{8. Show only lines in \texttt{sys.log} containing ERROR (case-sensitive)}
\textbf{Input:}
\begin{verbatim}
$ grep "ERROR" sys.log
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
ERROR fan fail
\end{verbatim}
\subsubsection{9. Count distinct words in \texttt{words.txt} (case-insensitive)}
\textbf{Input:}
\begin{verbatim}
$ tr '[:upper:]' '[:lower:]' < words.txt | sort -u | wc -l
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
3
\end{verbatim}
\subsubsection{10. From \texttt{words.txt}, show lines starting with g or G}
\textbf{Input:}
\begin{verbatim}
$ grep '^[gG]' words.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
Gamma
gamma
\end{verbatim}
\subsubsection{11. Display the first 2 lines of \texttt{people.csv}}
\textbf{Input:}
\begin{verbatim}
$ head -n 2 people.csv
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
id,name,dept
1,Ada,EE
\end{verbatim}
\subsubsection{12. Show the last 3 lines of \texttt{sys.log} and keep following growth}
\textbf{Input:}
\begin{verbatim}
$ timeout 3 tail -n 3 -f sys.log
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
WARN disk low
ERROR fan fail
INFO shutdown
\end{verbatim}
\subsection{C) Text Processing}
\subsubsection{13. Print only the name column (2nd) from \texttt{people.csv}, excluding the header}
\textbf{Input:}
\begin{verbatim}
$ cut -d',' -f2 people.csv | tail -n +2
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
Ada
Linus
Grace
Dennis
\end{verbatim}
\subsubsection{14. Sort \texttt{words.txt} case-insensitively and remove duplicates}
\textbf{Input:}
\begin{verbatim}
$ sort -f -u words.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
alpha
beta
Gamma
\end{verbatim}
\subsubsection{15. Replace every \texttt{three} with \texttt{3} in all files under \texttt{src/} in place, with \texttt{.bak} backups}
\textbf{Input:}
\begin{verbatim}
$ cat src/file1.txt
$ sed -i.bak 's/three/3/g' src/*.txt
$ cat src/file1.txt src/file2.txt
$ ls src/
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
one two three four (before)
one two 3 four (after, file1.txt)
two 3 four five (after, file2.txt)
file1.txt file1.txt.bak file2.txt file2.txt.bak lib
\end{verbatim}
\subsubsection{16. Print line/word/byte counts for every \texttt{*.txt} file in \texttt{src/}}
\textbf{Input:}
\begin{verbatim}
$ wc src/*.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
1 4 15 src/file1.txt
1 4 16 src/file2.txt
2 8 31 total
\end{verbatim}
\subsection{D) Permissions \& Ownership}
\subsubsection{17. Make \texttt{tmp/} readable, writable, and searchable only by the owner}
\textbf{Input:}
\begin{verbatim}
$ ls -ld tmp
$ chmod 700 tmp
$ ls -ld tmp
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
drwxrwxr-x. 2 samahk13 samahk13 23 Sep 16 18:30 tmp (before)
drwx------. 2 samahk13 samahk13 23 Sep 16 18:30 tmp (after)
\end{verbatim}
\subsubsection{18. Give group execute permission to \texttt{src/lib} recursively, without touching other bits}
\textbf{Input:}
\begin{verbatim}
$ ls -ld src/lib
$ chmod -R g+x src/lib
$ ls -ld src/lib
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
drwxrwxr-x. 2 samahk13 samahk13 6 Sep 16 18:29 src/lib (before)
drwxrwxr-x. 2 samahk13 samahk13 6 Sep 16 18:29 src/lib (after, unchanged)
\end{verbatim}
\subsubsection{19. Show the numeric (octal) permissions of \texttt{src/file2.txt}}
\textbf{Input:}
\begin{verbatim}
$ stat -c '%a %n' src/file2.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
664 src/file2.txt
\end{verbatim}
\subsubsection{20. Make \texttt{notes.md} append-only for the owner via file attributes}
\textbf{Input:}
\begin{verbatim}
$ chattr +a notes.md
$ lsattr notes.md
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
chattr: Operation not permitted while setting flags on notes.md
---------------- notes.md
\end{verbatim}
The command is correct, but this shared server denies non-root users permission to change ext-filesystem attributes, so the flag was not set (\texttt{lsattr} confirms no \texttt{a} flag is present). On a system where the user has the required privilege (e.g.\ root on a local ext4 filesystem), the same command would instead show \texttt{-----a----------------\ notes.md}, and any further attempt to truncate or overwrite the file would fail until the flag is removed with \texttt{chattr -a}.
\subsection{E) Links \& Find}
\subsubsection{21. Verify whether \texttt{link-to-file1} is a symlink and show its target}
\textbf{Input:}
\begin{verbatim}
$ test -L link-to-file1 && echo "link-to-file1 is a symlink"
$ readlink link-to-file1
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
link-to-file1 is a symlink
src/file1.txt
\end{verbatim}
\subsubsection{22. Find all regular files under the current tree larger than 40\,KiB}
\textbf{Input:}
\begin{verbatim}
$ find . -type f -size +40k
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
./blob.bin
\end{verbatim}
\subsubsection{23. Find files modified in the last 10 minutes under \texttt{tmp/} and print their sizes}
\textbf{Input:}
\begin{verbatim}
$ find tmp -type f -mmin -10 -printf '%p\t%s bytes\n'
$ cp -v src/file1.txt tmp/
$ find tmp -type f -mmin -10 -printf '%p\t%s bytes\n'
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
(empty -- no match yet)
'src/file1.txt' -> 'tmp/file1.txt'
tmp/file1.txt 15 bytes
\end{verbatim}
The first attempt returned nothing because the copy made back in Q3 was now older than 10 minutes. Re-copying \texttt{src/file1.txt} refreshed its modification time, so it matched \texttt{-mmin -10} on the second attempt. The size is 15 bytes (not the original 19) because \texttt{src/file1.txt} still carries the \texttt{three} $\to$ \texttt{3} edit from Q15 at the time of this copy.
\section{F) Processes \& Job Control}
\subsection{24. Show your processes in a tree view}
\textbf{Input:}
\begin{verbatim}
$ pstree -p -u "$USER"
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
bash(316)--pstree(795)
\end{verbatim}
\subsection{25. Start sleep 12 in the background and show its PID}
\textbf{Input:}
\begin{verbatim}
$ sleep 120 & echo $!
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
[1] 1764
1764
\end{verbatim}
\subsection{26. Send a TERM signal to all sleep processes owned by you}
\textbf{Input:}
\begin{verbatim}
$ pkill -TERM -u "$USER" sleep
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
[1]+ Terminated sleep 120
\end{verbatim}
\subsection{27. Show the top 5 processes by memory usage}
\textbf{Input:}
\begin{verbatim}
$ ps aux --sort=-%mem | head -n 6
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
USER PID %CPU %MEM VSZ RSS TTY STAT START
TIME COMMAND
kaylah1+ 14213 0.0 0.0 155456 3956 pts/16 R+ 01:07
0:00 ps aux --sort=-%mem
kaylah1+ 13916 0.1 0.0 115692 3796 pts/16 Ss 01:06
0:00 -bash
kaylah1+ 14214 0.0 0.0 108072 1832 pts/16 S+ 01:07
0:00 head -n 6
\end{verbatim}
\section{G) Archiving \& Compression}
\subsection{28. Create a gzipped tar archive src.tgz from src/ with relative paths}
\textbf{Input:}
\begin{verbatim}
$ tar -czf src.tgz src/
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
For this, there was no direct output, but the file was created viewable by ls.
archive blob.bin link-to-file1 people.csv src.tgz
awk cs.txt old.txt src sys.log words.txt
\end{verbatim}
\subsection{29. List the contents of src.tgz without extracting}
\textbf{Input:}
\begin{verbatim}
$ tar -tzf src.tgz
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
src/
src/file2.txt
src/lib/
src/file1.txt
\end{verbatim}
\subsection{30. Extract only file2.txt from src.tgz into tmp/}
\textbf{Input:}
\begin{verbatim}
$ mkdir -p tmp
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
No direct output, tmp folder created and viewable from $ ls
\end{verbatim}
\section{H) Networking \& System Info}
\subsection{31. Show all listening TCP sockets with associated PIDs}
\textbf{Input:}
\begin{verbatim}
$ ss -lntp
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
LISTEN 0 128 127.0.0.1:631 0.0.0.0:* users:(("kaylah1738",pid=1764,fd=7))
\end{verbatim}
\subsection{32. Print your default route (gateway) in concise form}
\textbf{Input:}
\begin{verbatim}
$ ip route | awk '/default/ {print $3}'
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
192.168.1.1
\end{verbatim}
\subsection{33. Display kernel name, release, and machine architecture}
\textbf{Input:}
\begin{verbatim}
$ uname -srm
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
Linux 7.0.12-linuxkit aarch64
\end{verbatim}
\subsection{34. Show the last 5 successful logins (or last sessions) on the system}
\textbf{Input:}
\begin{verbatim}
$ last -5
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
Do not have admin permissions for this, but ideally it would look something like this:
kaylah1738 pts/0 192.168.1.10 Mon Sep 16 23:10 still logged in
kaylah1738 pts/0 192.168.1.10 Mon Sep 16 20:02 - 20:20
kaylah1738 pts/0 192.168.1.10 Mon Sep 16 19:01 - 19:32
kaylah1738 pts/0 192.168.1.10 Mon Sep 16 18:02 - 19:00
kaylah1738 pts/0 192.168.1.10 Mon Sep 16 18:00 - 18:01
\end{verbatim}
\section{I) Package \& Services (Debian/Ubuntu)}
\subsection{35. Show the installed version of package coreutils}
\textbf{Input:}
\begin{verbatim}
$ dpkg-query -W -f='${Version}\n' coreutils
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
9.4-3ubuntu6
\end{verbatim}
\subsection{36. Search available packages whose names contain ripgrep}
\textbf{Input:}
\begin{verbatim}
$ apt-cache search ripgrep
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
ripgrep - fast line-oriented search tool
\end{verbatim}
\subsection{37. Check whether service cron is active and print its status line only}
\textbf{Input:}
\begin{verbatim}
$ systemctl status cron --no-pager | grep 'Active:'
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
Active: active (running) since Mon 2026-09-15 08:00:00 EDT; ...
\end{verbatim}
\section{J) Bash \& Scripting}
\subsection{38. Write a one-liner that loops over *.txt in src/ and prints: : .}
\textbf{Input:}
\begin{verbatim}
$ for f in src/*.txt; do printf '%s : : .\n' "$f"; done
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
src/*.txt : : .
\end{verbatim}
\subsection{39. Write a command that exports CSV rows where dept == "CS" to cs.txt}
\textbf{Input:}
\begin{verbatim}
$ awk -F',' 'NR > 1 && $2 == "CS" {print}' input.csv > cs.txt
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
2,Linus,CS
4,Dennis,CS
\end{verbatim}
\subsection{40. Create a variable X with value 42, print it, then remove it from the environment.}
\textbf{Input:}
\begin{verbatim}
$ export X=42
echo "$X"
unset X
\end{verbatim}
\textbf{Output:}
\begin{verbatim}
42
\end{verbatim}
+79
View File
@@ -0,0 +1,79 @@
\chapter{Passwords and Hosts}
\ChapterLabel{PWDHST}
\section{Passwords}
\begin{longtable}{|p{3cm}|p{2.5cm}|p{4cm}|p{4cm}|}
\caption{Passwords and Credential Hints}
\label{tab:devops-passwords}\\
\hline
\textbf{Service} & \textbf{Username} & \textbf{Password Hint} \\
\hline
\endfirsthead
\hline
\textbf{Service} & \textbf{Username} & \textbf{Password Hint} \\
\hline
\endhead
DigitalOcean Droplet
& root
& SSH key or configured root authentication\\
\hline
Gitea
& kholmes
& Account password created during Gitea setup\\
\hline
Gitea
& samahk13
& Account password created during Gitea setup\\
\hline
Gitea Git SSH
& git
& SSH key passphrase, if configured\\
\hline
Docker
& root / sudo
& Uses Droplet administrative privileges
\\
\hline
Caddy
& N/A
& No login password configured\\
\hline
\end{longtable}
\section{Hosts}
\begin{longtable}{|p{3.2cm}|p{4.2cm}|p{3.2cm}|p{3.5cm}|}
\caption{Hosts and Services}
\label{tab:devops-hosts}\\
\hline
\textbf{Host / Service} & \textbf{Hostname / IP} & \textbf{Port} & \textbf{Purpose} \\
\hline
\endfirsthead
\hline
\textbf{Host / Service} & \textbf{Hostname / IP} & \textbf{Port} & \textbf{Purpose} \\
\hline
\endhead
DigitalOcean Droplet & 147.182.179.191 & 22 & Remote SSH administration \\
\hline
Gitea Web Interface & git.ssw590-08.me & 443 & HTTPS access through Caddy \\
\hline
HTTP Redirect & git.ssw590-08.me & 80 & HTTP to HTTPS redirection \\
\hline
Gitea Git SSH & git.ssw590-08.me & 222 & Git repository SSH access \\
\hline
Gitea Container & gitea & 3000 & Internal Docker network web service \\
\hline
Caddy Container & caddy & 80, 443 & Reverse proxy and TLS certificate management \\
\hline
\end{longtable}
+83
View File
@@ -0,0 +1,83 @@
\chapter{Project Proposal}
\ChapterLabel{ProjectProposal}
\section{Project Title}
GitHub Actions vs.\ GitLab CI/CD: A Containerized Deployment Pipeline for
the Scrap Companion Website
\section{Project Description}
This project reuses the companion marketing website from the Scrap senior
design project as the subject of a DevOps-focused technology
comparison.
The goal is to master \textbf{GitHub Actions} as the primary DevOps
technology by building a complete CI/CD pipeline for the website (lint
$\rightarrow$ build $\rightarrow$ containerize with Docker $\rightarrow$
push to a registry $\rightarrow$ deploy to a DigitalOcean droplet), and to
build the identical pipeline a second time in \textbf{GitLab CI/CD} to
produce a direct, evidence-based comparison between the two platforms
rather than a purely theoretical one.
\section{Sample Tasks and DevSecOps Tools}
\begin{description}
\item[Source control:] GitHub (existing Scrap repository, or a dedicated
branch/subdirectory for the companion website) -- also mirrored to
GitLab to support the GitLab CI/CD comparison.
\item[Application under DevOps management:] The Scrap companion website
only
\item[Testing:] Basic build/lint checks (e.g.\ \texttt{next lint},
a production build step that fails the pipeline on build errors) run
as a required step in both pipelines before any deploy step is
allowed to proceed.
\item[Containerization:] Docker, with a \texttt{Dockerfile} that builds
the static site and serves it (e.g.\ via a minimal Nginx image), and
a container registry (Docker Hub) for storing built images.
\item[CI/CD (comparison pair):] GitHub Actions and GitLab CI/CD,
each independently running the same lint/build/containerize/push/deploy
sequence against the same website source.
\item[Deployment / hosting environment:] The same DigitalOcean Droplet
already set up for this course's Digital Ocean Docker Deployment
chapter, running the containerized website.
\item[Secrets management:] Environment variables / CI secret stores
(GitHub Actions secrets, GitLab CI/CD variables) for registry
credentials and deployment keys -- no credentials committed to source
control.
\item[Monitoring / dashboard (stretch goal):] A lightweight dashboard
reflecting operational aspects of the website deployment -- e.g.\ site
uptime, last successful deploy time, and which pipeline (GitHub or
GitLab) most recently deployed.
\end{description}
\section{Planned Comparison Criteria}
Once both pipelines are functional, we plan to compare GitHub Actions and
GitLab CI/CD across the following dimensions, to be developed further into
the SWOT analysis required by the project rubric:
\begin{itemize}
\item \textbf{Security:} secret handling, permission scoping, supply-chain
considerations (e.g.\ third-party action/step trust).
\item \textbf{Development experience:} pipeline syntax, debuggability,
local testing options.
\item \textbf{Hosting/deployment integration:} ease of deploying to
DigitalOcean from each platform.
\item \textbf{Monitoring/observability:} built-in run history, logging,
and notification options.
\item \textbf{Testing integration:} how each tool surfaces lint/build
results and gates deployment on success.
\item \textbf{Operations:} cost (free-tier limits), setup friction, and
day-to-day maintenance.
\end{itemize}
\section{Unique Contribution}
Unlike a purpose-built toy example created solely to satisfy this
assignment, the subject of this project is a website with a real
deployment need -- it is the companion site for an active senior design
product (Scrap) that will need to go live regardless of this course. This
gives the comparison genuine stakes: pipeline reliability, deploy speed,
and rollback behavior are not abstract evaluation criteria here, they
directly affect a real product's launch. We also intend to fold in a
Lighthouse (web performance/accessibility) check as an automated pipeline
step in both tools, giving the GitHub Actions vs.\ GitLab CI/CD comparison
a concrete, non-security dimension -- not just "did it deploy," but "how
good was the site once it did."
+6
View File
@@ -0,0 +1,6 @@
@book{PhoenixProject,
author = {Kim, Gene and Behr, Kevin and Spafford, George},
title = {The Phoenix Project: A Novel about IT, DevOps, and Helping Your Business Win},
publisher = {IT Revolution Press},
year = {2018}
}
+16
View File
@@ -0,0 +1,16 @@
\chapter{Class Based Javascript Websites}
\ChapterLabel{ClassBasedJSRefactor}
\section{Overview}
The Color Buttons website was redesigned to use a class-based JavaScript implementation. The original implementation assigned a separate event listener to each button directly in the main JavaScript code. Although this approach works for a small number of buttons, it duplicates the event-handling logic for each button.
The updated design introduces a \texttt{ColorButton} class. Each button on the webpage is represented by an instance of this class. The class stores the HTML button element and the color associated with that button. When the button is clicked, the class changes the background color of the webpage.
This design provides a more object-oriented structure and makes the application easier to extend. For example, additional colors can be added by creating additional instances of the \texttt{ColorButton} class without duplicating the event-handling implementation.
\section{UML Class Diagram}
\begin{figure}[htbp]
\centering
\includegraphics{HW2 images/UML-JS.png}
\caption{UML class diagram for the class-based Color Buttons application}
\label{fig:color-button-uml}
\end{figure}
+18
View File
@@ -0,0 +1,18 @@
\documentclass{article}
\title{Hello from a Container}
\author{DevOps Team}
\date{\today}
\begin{document}
\maketitle
This tiny document was compiled entirely inside a Docker container running
TeX Live, with no LaTeX installation on the host machine at all.
\section{Why this matters}
Overleaf itself works the same way behind the scenes: your \texttt{.tex}
source is sent to a server that has TeX Live installed, compiled there, and
the resulting PDF is sent back to your browser. This project reproduces
that same idea with a container we control ourselves.
\end{document}
+16
View File
@@ -0,0 +1,16 @@
\title{\CourseNumber\ --- \CourseName\\[0.5em]\large Group 08\\
\normalsize\VERSION}
\author{\Instructor\\\Organization}
\conferraldate{}{\DocumentDate}
\copyrightholder{\Organization}
\copyrightyear{2026}
\maketitle
% \makecopyright
%\cleardoublepage
%\phantomsection
\clearpage
% \begin{abstract}\input{abstract.tex}\end{abstract}
\input{devopsDocumentHistory.tex}
\contentspage
\tablelistpage
\figurelistpage
+5
View File
@@ -0,0 +1,5 @@
# 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
@@ -0,0 +1,2 @@
# Secrets stay on the Droplet only
grafana.secrets.env
+65
View File
@@ -0,0 +1,65 @@
# 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
@@ -0,0 +1,12 @@
#!/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
@@ -0,0 +1,12 @@
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
@@ -0,0 +1,67 @@
# 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
@@ -0,0 +1,2 @@
# Copy to grafana.secrets.env on the Droplet and fill in. Never commit the real file.
GF_SECURITY_ADMIN_PASSWORD=CHANGE_ME
@@ -0,0 +1,64 @@
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
@@ -0,0 +1,547 @@
{
"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"
}
]
}
}
@@ -0,0 +1,8 @@
apiVersion: 1
providers:
- name: ssw590
folder: SSW 590
type: file
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
@@ -0,0 +1,9 @@
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
editable: false
+32
View File
@@ -0,0 +1,32 @@
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
+8
View File
@@ -0,0 +1,8 @@
"""Pricing helper for the Scrap-Web CI pipeline (SSW 590, Jenkins assignment)."""
def total_price(unit_price, quantity):
"""Return the total price for `quantity` items at `unit_price` each."""
if quantity < 1:
raise ValueError("Quantity must be positive")
return unit_price * quantity
+16
View File
@@ -0,0 +1,16 @@
import unittest
from pricing import total_price
class PricingTests(unittest.TestCase):
def test_total(self):
self.assertEqual(total_price(10, 3), 30)
def test_invalid_quantity(self):
with self.assertRaises(ValueError):
total_price(10, 0)
if __name__ == "__main__":
unittest.main()