Compare commits

..

2 Commits

Author SHA1 Message Date
30431709d3 Merge branch 'main' of https://gitea.thewrightserver.net/josh/WorkWeekProgress 2026-01-11 22:06:45 -05:00
e7d32152d5 adds ci cd 2026-01-11 22:06:41 -05:00
3 changed files with 70 additions and 0 deletions

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
COPY templates ./templates
COPY static ./static
EXPOSE 5000
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]

54
Jenkinsfile vendored Normal file
View File

@@ -0,0 +1,54 @@
pipeline {
agent any
environment {
REGISTRY = "gitea.yourdomain.com"
IMAGE = "gitea.yourdomain.com/<username>/work-week-progress"
TAG = "${env.BUILD_NUMBER}"
}
stages {
stage("Checkout") {
steps {
checkout scm
}
}
stage("Build Image") {
steps {
sh """
docker build \
-t ${IMAGE}:${TAG} \
-t ${IMAGE}:latest \
.
"""
}
}
stage("Push Image") {
steps {
withCredentials([
usernamePassword(
credentialsId: 'gitea-registry-creds',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN'
)
]) {
sh """
echo "$GITEA_TOKEN" | docker login ${REGISTRY} \
-u "$GITEA_USER" --password-stdin
docker push ${IMAGE}:${TAG}
docker push ${IMAGE}:latest
"""
}
}
}
}
post {
cleanup {
sh "docker image prune -f"
}
}
}

2
requirements.txt Normal file
View File

@@ -0,0 +1,2 @@
flask
gunicorn