From b8ee292d45b6dec12b8a9f3f92369cbb65655475 Mon Sep 17 00:00:00 2001 From: SergioEspin Date: Mon, 12 Oct 2026 16:08:44 -0400 Subject: [PATCH] Add Gitea Actions manual build chapter --- .gitea/workflows/manual-pdf.yml | 47 ++++++++++ devopsAssignment.tex | 9 +- devopsBuildMetadata.tex | 4 + devopsDocumentHistory.tex | 14 +++ devopsGiteaActions.tex | 151 ++++++++++++++++++++++++++++++ devopsGlossary.tex | 4 + devopsReferences.bib | 48 ++++++++++ ops/gitea-actions/runner-notes.md | 12 +++ 8 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 .gitea/workflows/manual-pdf.yml create mode 100644 devopsBuildMetadata.tex create mode 100644 devopsGiteaActions.tex create mode 100644 ops/gitea-actions/runner-notes.md diff --git a/.gitea/workflows/manual-pdf.yml b/.gitea/workflows/manual-pdf.yml new file mode 100644 index 0000000..3cb0de8 --- /dev/null +++ b/.gitea/workflows/manual-pdf.yml @@ -0,0 +1,47 @@ +# Gitea Actions workflow for the SSW 590 DevOps IT manual. +# The runner label must match the registered self-managed Gitea runner. +name: manual-pdf + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + build-manual: + runs-on: latex-docker + container: + image: texlive/texlive:TL2026-historic + steps: + - name: Check out source + uses: actions/checkout@v4 + + - name: Generate build metadata + shell: bash + run: | + set -eu + short_sha="${GITHUB_SHA:-unknown}" + short_sha="${short_sha:0:7}" + run_number="${GITHUB_RUN_NUMBER:-0}" + run_attempt="${GITHUB_RUN_ATTEMPT:-1}" + cat > devopsBuildMetadata.tex <-}.\\ +Retention setting & \texttt{14} days in the workflow. This is an artifact retention setting, not a backup policy.\\ +Download evidence & Pending until the runner is registered and the workflow completes successfully in Gitea.\\ +\end{longtable} + +\section{Change, Failure, and Repair Evidence} +The final Chapter 3 evidence still needs three live Actions runs: two successful source changes and one safe failed compile followed by a repaired passing run. The safe failure should be made on a branch covered by the workflow, for example by temporarily introducing a harmless LaTeX syntax error in a draft branch, confirming the job fails, then repairing it and confirming the artifact builds. + +\section{Runner and Secret Boundary} +Runner registration tokens, Gitea tokens, and any repository secrets must not be committed, printed in the PDF, or stored in workflow logs. Workflow edit rights should be limited to trusted team members because workflow code can execute commands in the runner environment. If Docker execution is used on the same Droplet as Gitea, the team must treat Docker socket access as privileged host access and avoid giving untrusted pull requests access to secrets or privileged labels. + +\section{Manual Quality and Controls} +\begin{longtable}{L{4.4cm}L{2.0cm}L{6.8cm}} +\caption{Chapter 3 Rubric Evidence Status\label{Table:GiteaActionsRemainingWork}}\\ +\toprule +\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence or Gap}\\ +\midrule +\endfirsthead +\toprule +\textbf{Rubric Criterion} & \textbf{Status} & \textbf{Evidence or Gap}\\ +\midrule +\endhead +\bottomrule +\endlastfoot +Versioned source and push-triggered workflow & Partial & Workflow file and build metadata hook were added. Source still needs to be pushed to the Gitea repository used for evidence.\\ +Registered runner and documented execution environment & Pending & Runner plan and label are documented, but live registration requires Gitea admin or SSH access.\\ +Reproducible LaTeX compilation and failure detection & Partial & Workflow command, image, and missing-PDF check are documented. Live run log is pending.\\ +Visible commit/run version traceability in the PDF & Partial & Metadata mechanism is implemented. A real Actions-produced PDF with run number and commit hash is pending.\\ +Downloadable, verified PDF artifact & Pending & Artifact upload is configured, but no live artifact is verified yet.\\ +Two builds plus controlled failure and repair & Pending & Requires live runner execution.\\ +Runner permissions and secret boundary & Partial & Secret and workflow-author risks are documented; live runner token storage remains pending.\\ +Versioned IT manual, history, tables, and evidence & Partial & Version, history, citations, glossary/index terms, workflow, and troubleshooting notes were added; final live evidence remains pending.\\ +\end{longtable} + +\begin{devopsNote}[Troubleshooting Procedure] +If a Gitea Actions build does not start, check that Actions are enabled for the repository, the workflow file is under \texttt{.gitea/workflows/}, the push targets the selected branch, and the runner is online with the label \texttt{latex-docker}. If the build starts but fails, inspect the \texttt{latexmk} log, confirm \texttt{devopsBuildMetadata.tex} was generated, and verify that \texttt{devopsAssignment.pdf} exists before artifact upload. +\end{devopsNote} + diff --git a/devopsGlossary.tex b/devopsGlossary.tex index 06c58f4..946e4b7 100644 --- a/devopsGlossary.tex +++ b/devopsGlossary.tex @@ -20,3 +20,7 @@ \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{giteaactions}{name={Gitea Actions},description={Gitea's built-in workflow automation system for running jobs such as builds and artifact uploads}} +\newglossaryentry{artifact}{name={artifact},description={A build output retained by a workflow run, such as a generated PDF, for later download and review}} +\newglossaryentry{runner}{name={runner},description={A self-managed service that polls Gitea for workflow jobs and executes them in a configured environment}} + diff --git a/devopsReferences.bib b/devopsReferences.bib index 327bba0..77d2be8 100644 --- a/devopsReferences.bib +++ b/devopsReferences.bib @@ -84,3 +84,51 @@ year = {2026}, note = {Accessed October 7, 2026} } + +@misc{GiteaActionsQuickstart, + author = {{Gitea}}, + title = {Gitea Actions Quick Start}, + howpublished = {\url{https://docs.gitea.com/usage/actions/quickstart/}}, + year = {2026}, + note = {Accessed October 12, 2026} +} + +@misc{GiteaActionsArtifacts, + author = {{Gitea}}, + title = {Gitea Actions Artifacts}, + howpublished = {\url{https://docs.gitea.com/usage/actions/artifacts/}}, + year = {2026}, + note = {Accessed October 12, 2026} +} + +@misc{GiteaRunnerDocker, + author = {{Gitea}}, + title = {Install Gitea Runner with Docker}, + howpublished = {\url{https://docs.gitea.com/runner/2/installation/docker/}}, + year = {2026}, + note = {Accessed October 12, 2026} +} + +@misc{GiteaRunnerLabels, + author = {{Gitea}}, + title = {Gitea Runner Labels}, + howpublished = {\url{https://docs.gitea.com/runner/labels/}}, + year = {2026}, + note = {Accessed October 12, 2026} +} + +@misc{LatexmkCtan, + author = {{CTAN}}, + title = {latexmk -- Fully Automated LaTeX Document Generation}, + howpublished = {\url{https://ctan.org/pkg/latexmk}}, + year = {2026}, + note = {Accessed October 12, 2026} +} + +@misc{TexLiveTug, + author = {{TeX Users Group}}, + title = {TeX Live}, + howpublished = {\url{https://tug.org/texlive/}}, + year = {2026}, + note = {Accessed October 12, 2026} +} diff --git a/ops/gitea-actions/runner-notes.md b/ops/gitea-actions/runner-notes.md new file mode 100644 index 0000000..e39b98d --- /dev/null +++ b/ops/gitea-actions/runner-notes.md @@ -0,0 +1,12 @@ +# Gitea Actions runner notes + +Target runner label: latex-docker +Execution mode: Docker job container +Preferred job image: texlive/texlive:TL2026-historic +Workflow path: .gitea/workflows/manual-pdf.yml +Main file: devopsAssignment.tex +Build command: latexmk -norc -pdf -shell-escape -interaction=nonstopmode -halt-on-error devopsAssignment.tex +Artifact: devopsAssignment.pdf uploaded from the matching Actions run + +The live runner registration still requires authenticated Gitea administration or SSH access to the Droplet. +Do not commit runner registration tokens, Gitea tokens, or private keys.