Add Assignment 6 Python application and Jenkins pipeline
myfileagent-python-ci/pipeline/head This commit looks good

This commit is contained in:
Codex (authorized Assignment 5 implementation)
2026-10-09 18:33:17 +00:00
parent 4a67a09780
commit 041adfcda4
6 changed files with 91 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# Assignment 6 Python CI
The pipeline runs on the trusted Jenkins controller executor. Only trusted
team members may change pipeline code. Do not supply secrets or privileged
Docker access to untrusted pull requests. Fork PR discovery is disabled.
The controller uses the official Jenkins LTS image recorded in compose.jenkins.yaml.
Python comes from that image's Debian package repositories; record the actual
Python version from each build. No pip dependencies or Docker socket are needed.
After replacing the container, run `sh ops/jenkins/install-python.sh` on the
Droplet before building. A restart retains Python; replacement requires reinstall.
Jenkins jobs and settings persist in the jenkins-home volume.
From the repository root, reproduce checks with:
python3 -m py_compile pricing.py tests/test_pricing.py
python3 -m unittest discover -s tests -v
Expected: both tests pass. Syntax or test failures must fail the Jenkins run.
Multibranch origin PR discovery tests the current PR revision, not a merged revision.
The printed checkout commit identifies what was actually tested.
Webhook delivery, status reporting, branch protection, and the controlled
failure/repair demonstration must be configured and verified separately.
+17
View File
@@ -0,0 +1,17 @@
services:
jenkins:
image: jenkins/jenkins@sha256:a660310e39ade10631f774bacd5219de767dfd08947ea5c32a739b5e5bb382c1
container_name: myfileagent-jenkins
restart: unless-stopped
environment:
JAVA_OPTS: "-Xms64m -Xmx256m"
mem_limit: 448m
ports:
- "127.0.0.1:8080:8080"
volumes:
- jenkins-home:/var/jenkins_home
networks:
- gitea-private
volumes:
jenkins-home:
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
# Run on the Droplet after recreating the official Jenkins container.
# Python installed in the container survives restart, not container replacement.
set -eu
docker exec -u root myfileagent-jenkins sh -c 'apt-get update -qq && apt-get install -y --no-install-recommends python3'
docker exec myfileagent-jenkins python3 --version