Author SHA1 Message Date
willemjan c4ae6fc037 test indent issue
willemjan/glucose-dashboard/pipeline/head This commit looks good
2026-08-28 21:51:40 +02:00
willemjan 11489bccdd removed secrets
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 21:47:39 +02:00
willemjan 53bc8a0121 fix configmap in jenkins
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 21:45:41 +02:00
willemjan 8dd3d5acea added secrets and env variables to openshift deployment
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 21:43:16 +02:00
willemjan 0fb9a0c0a2 fix oc_project
willemjan/glucose-dashboard/pipeline/head This commit looks good
2026-08-28 14:42:03 +02:00
willemjan 0017d14936 fix test issue
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 14:33:13 +02:00
willemjan 17279b69f1 updated test stage
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 14:29:49 +02:00
willemjan ae0c736ea7 updated scan stage
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-28 14:24:48 +02:00
willemjan 1f2b0d917a test
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-15 22:20:12 +02:00
willemjan 908fd6f730 req dev file removed
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 23:58:57 +02:00
willemjan c2bbc5a753 test in own container
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 23:56:28 +02:00
willemjan abf0c95bac roll back
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 23:49:47 +02:00
willemjan 76f27f674d any agent
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 23:42:45 +02:00
willemjan 3e18aadc8f updated commenting
willemjan/glucose-dashboard/pipeline/head Something is wrong with the build of this commit
2026-08-13 23:31:33 +02:00
willemjan 290022ab8e test
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 23:24:16 +02:00
willemjan e8159771de test scratch pipeline
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 22:30:37 +02:00
willemjan 3c534fec3a updated credentials Id
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-13 22:24:38 +02:00
willemjan 7c729f38ec test
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-11 01:01:30 +02:00
willemjan 164ac5e42d test openshigt
willemjan/glucose-dashboard/pipeline/head There was a failure building this commit
2026-08-11 00:28:56 +02:00
willemjan e08f269855 test jenkins
willemjan/glucose-dashboard/pipeline/head Something is wrong with the build of this commit
2026-08-10 23:19:27 +02:00
6 changed files with 178 additions and 3 deletions
+11 -3
View File
@@ -1,5 +1,12 @@
FROM python:3.12-slim
ENV HOME=/app \
PYTHONUNBUFFERED=1 \
STREAMLIT_SERVER_PORT=8501 \
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
STREAMLIT_SERVER_HEADLESS=true \
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
WORKDIR /app
# Systeem-dependency voor de HEALTHCHECK hieronder
@@ -11,8 +18,9 @@ RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN chgrp -R 0 /app && chmod -R g=u /app
USER 1001
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
CMD ["streamlit", "run", "app.py"]
Vendored
+103
View File
@@ -0,0 +1,103 @@
pipeline {
agent {
label 'ssh-agent'
}
environment {
REGISTRY = 'gitea.zb-kw.duckdns.org'
IMAGE = "${REGISTRY}/willemjan/glucose-dashboard"
OC_SERVER = 'https://api.rm1.0a51.p1.openshiftapps.com:6443'
OC_PROJECT = 'wulsspaans-dev'
}
options {
buildDiscarder(logRotator(numToKeepStr: '20'))
timeout(time: 20, unit: 'MINUTES')
}
stages {
stage('Checkout') {
steps {
checkout scm
script {
env.TAG = sh(script: 'git rev-parse --short HEAD',
returnStdout: true).trim()
}
}
}
stage('Test') {
steps {
sh '''
pip install --break-system-packages --no-warn-script-location -q -r requirements.txt
python -m pytest -q --junitxml=report.xml
'''
}
post {
always { junit allowEmptyResults: true, testResults: 'report.xml' }
}
}
stage('Build & push image') {
steps {
withCredentials([usernamePassword(
credentialsId: 'gitea_user',
usernameVariable: 'REG_USER',
passwordVariable: 'REG_PASS')]) {
sh '''
echo "$REG_PASS" | docker login $REGISTRY -u "$REG_USER" --password-stdin
docker build -t $IMAGE:$TAG -t $IMAGE:latest .
docker push $IMAGE:$TAG
docker push $IMAGE:latest
'''
}
}
}
stage('Scan') {
steps {
sh '''
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v trivy-cache:/root/.cache/trivy \
aquasec/trivy:latest image \
--severity HIGH,CRITICAL \
--ignore-unfixed \
--exit-code 0 \
$IMAGE:$TAG
'''
}
}
stage('Deploy to OpenShift') {
steps {
withCredentials([string(
credentialsId: 'openshift-token',
variable: 'OC_TOKEN')]) {
sh '''
oc login --token="$OC_TOKEN" --server="$OC_SERVER"
oc project $OC_PROJECT
oc apply -f openshift/service.yaml
oc apply -f openshift/route.yaml
oc apply -f openshift/configmap.yaml
oc apply -f openshift/deployment.yaml
oc set image deployment/glucose-dashboard \
glucose-dashboard=$IMAGE:$TAG
oc rollout status deployment/glucose-dashboard --timeout=5m
'''
}
}
post {
always { sh 'oc logout || true' }
success {
sh 'echo "Deployed: $(oc get route glucose-dashboard -o jsonpath={.spec.host})" || true'
}
}
}
}
}
+6
View File
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: glucose-dashboard-config
data:
NIGHTSCOUT_URL: "https://zb-ns.duckdns.org"
+35
View File
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: glucose-dashboard
labels:
app: glucose-dashboard
spec:
replicas: 1
selector:
matchLabels:
app: glucose-dashboard
template:
metadata:
labels:
app: glucose-dashboard
spec:
imagePullSecrets:
- name: gitea-registry
containers:
- name: glucose-dashboard
image: PLACEHOLDER
envFrom:
- configMapRef:
name: glucose-dashboard-config
ports:
- containerPort: 8501
resources:
requests: { cpu: 100m, memory: 256Mi }
limits: { cpu: 500m, memory: 512Mi }
readinessProbe:
httpGet: { path: /_stcore/health, port: 8501 }
initialDelaySeconds: 10
livenessProbe:
httpGet: { path: /_stcore/health, port: 8501 }
initialDelaySeconds: 30
+13
View File
@@ -0,0 +1,13 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: glucose-dashboard
spec:
to:
kind: Service
name: glucose-dashboard
port:
targetPort: 8501
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
+10
View File
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: glucose-dashboard
spec:
selector:
app: glucose-dashboard
ports:
- port: 8501
targetPort: 8501