From de7b27bd71b165d825d7614c256395f43d0be459 Mon Sep 17 00:00:00 2001 From: jared Date: Mon, 30 Jun 2025 07:17:53 +0200 Subject: [PATCH 01/37] Jenkinsfile aktualisiert Added additional Infos in pull request --- Jenkinsfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 5b408ff..ede5ffb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,6 +12,11 @@ pipeline { TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') } + parameters { + string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') + string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref') + } + options { buildDiscarder( BuildHistoryManager([ From fe9f8add88ea91ad32dcc13e32fdd9694d27d2eb Mon Sep 17 00:00:00 2001 From: Jared Date: Mon, 30 Jun 2025 08:35:20 +0200 Subject: [PATCH 02/37] fixed tatort api route for deletion --- src/routes/(token-based)/list/[vorgang]/+page.svelte | 2 +- src/routes/api/list/{[[vorgang]] => [vorgang]}/+server.ts | 0 src/routes/api/{tatort => list/[vorgang]/[tatort]}/+server.ts | 0 src/routes/api/list/{[[vorgang]] => [vorgang]}/code/+server.ts | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename src/routes/api/list/{[[vorgang]] => [vorgang]}/+server.ts (100%) rename src/routes/api/{tatort => list/[vorgang]/[tatort]}/+server.ts (100%) rename src/routes/api/list/{[[vorgang]] => [vorgang]}/code/+server.ts (100%) diff --git a/src/routes/(token-based)/list/[vorgang]/+page.svelte b/src/routes/(token-based)/list/[vorgang]/+page.svelte index 4b3cde4..0805f70 100644 --- a/src/routes/(token-based)/list/[vorgang]/+page.svelte +++ b/src/routes/(token-based)/list/[vorgang]/+page.svelte @@ -208,7 +208,7 @@ url.pathname += `/${filename}`; try { - const response = await fetch(`api/${url}`, { method: 'DELETE' }); + const response = await fetch(`/api${url.pathname}`, { method: 'DELETE' }); if (response.status == 204) { setTimeout(() => { window.location.reload(); diff --git a/src/routes/api/list/[[vorgang]]/+server.ts b/src/routes/api/list/[vorgang]/+server.ts similarity index 100% rename from src/routes/api/list/[[vorgang]]/+server.ts rename to src/routes/api/list/[vorgang]/+server.ts diff --git a/src/routes/api/tatort/+server.ts b/src/routes/api/list/[vorgang]/[tatort]/+server.ts similarity index 100% rename from src/routes/api/tatort/+server.ts rename to src/routes/api/list/[vorgang]/[tatort]/+server.ts diff --git a/src/routes/api/list/[[vorgang]]/code/+server.ts b/src/routes/api/list/[vorgang]/code/+server.ts similarity index 100% rename from src/routes/api/list/[[vorgang]]/code/+server.ts rename to src/routes/api/list/[vorgang]/code/+server.ts From 2b2fa7a82be5132adc6979577f2c7add5678a8dd Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 06:56:31 +0200 Subject: [PATCH 03/37] added Dockerfile dev and prod --- Dockerfile.dev | 17 +++++++++++++++++ Dockerfile => Dockerfile.prod | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.dev rename Dockerfile => Dockerfile.prod (91%) diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..81e9c36 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,17 @@ +# --- Build stage --- +FROM node:22 AS build +ENV NODE_ENV=production +ENV ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de +WORKDIR /app +COPY package*.json ./ +RUN npm ci +COPY . ./ +COPY config.json_dev ./config.json +RUN npm run build + +# --- Production stage --- +FROM node:22-alpine3.20 +COPY --from=build /app . +ENV HOST=0.0.0.0 +EXPOSE 3000 +CMD ["sh", "-c", "ORIGIN=https://tatort-dev.innovation-hub-niedersachsen.de node build/index.js"] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile.prod similarity index 91% rename from Dockerfile rename to Dockerfile.prod index 50a19b5..2d92413 100644 --- a/Dockerfile +++ b/Dockerfile.prod @@ -6,6 +6,7 @@ WORKDIR /app COPY package*.json ./ RUN npm ci COPY . ./ +COPY config.json_prod ./config.json RUN npm run build # --- Production stage --- @@ -14,4 +15,3 @@ COPY --from=build /app . ENV HOST=0.0.0.0 EXPOSE 3000 CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"] - From 7018c74884dae9b137124ae14c1f4899841bb52d Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:07:07 +0200 Subject: [PATCH 04/37] added webhook to get discrod message --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ede5ffb..ef6e229 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,14 +59,14 @@ pipeline { // } // } // } - } + // } post { success { - echo 'Pipeline erfolgreich!' - } + echo 'Pipeline erfolgreich!', + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: "Building", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: "https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc"} + failure { - echo 'Pipeline fehlgeschlagen!' - } + echo 'Pipeline fehlgeschlagen!', + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: "Building", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: "https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc"} } -} From 021ec3d38349620e5a9ff1ad90fd0b5abae658fd Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:11:01 +0200 Subject: [PATCH 05/37] fixed jenkinsfile --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef6e229..08e3843 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,6 +39,7 @@ pipeline { sh 'npm audit' } } + } // stage('Build') { // when { @@ -63,10 +64,13 @@ pipeline { post { success { - echo 'Pipeline erfolgreich!', - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: "Building", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: "https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc"} + echo 'Pipeline erfolgreich!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } failure { - echo 'Pipeline fehlgeschlagen!', - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: "Building", link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: "https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc"} + echo 'Pipeline fehlgeschlagen!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } } +} From 2667db57554cc751db5fbd9392267ad39a5f211c Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:16:05 +0200 Subject: [PATCH 06/37] added git ref to message --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 08e3843..96b1d48 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -65,12 +65,12 @@ pipeline { post { success { echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' } failure { echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' } } } From 890380609fdbbf2d01542a9ed499df2f6b9799e2 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:25:04 +0200 Subject: [PATCH 07/37] added build id to image, set correct dockerfile --- Jenkinsfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 96b1d48..c69e9f0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -50,17 +50,17 @@ pipeline { // } // } - // stage('Push image in gitea registry') { - // steps { - // echo 'Start Pushing' - // script { - // docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { - // docker.build('innohub/tatort-app').push('latest') - // } - // } - // } - // } - // } + stage('Push image in gitea registry') { + steps { + echo 'Start Pushing' + script { + def dockerfile = 'Dockerfile.dev' + docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { + docker.build("innohub/tatort:${env.BUILD_ID}", "-f ${dockerfile} .").push('latest') + } + } + } + } post { success { From 30b49029b22b6966b4c22b0f2fb0256a667958fe Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:29:07 +0200 Subject: [PATCH 08/37] fixed jenkinsfile --- Jenkinsfile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c69e9f0..ea12da3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,6 +39,17 @@ pipeline { sh 'npm audit' } } + + stage('Push image to gitea registry') { + steps { + echo 'Start Pushing' + script { + docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { + docker.build("innohub/tatort:${env.BUILD_ID}", '-f Dockerfile.dev .').push('latest') + } + } + } + } } // stage('Build') { @@ -50,18 +61,6 @@ pipeline { // } // } - stage('Push image in gitea registry') { - steps { - echo 'Start Pushing' - script { - def dockerfile = 'Dockerfile.dev' - docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { - docker.build("innohub/tatort:${env.BUILD_ID}", "-f ${dockerfile} .").push('latest') - } - } - } - } - post { success { echo 'Pipeline erfolgreich!' From be4e351217f80b66bd3db8e6090c02a0c4e88bd7 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:34:58 +0200 Subject: [PATCH 09/37] test jenkins pipeline --- src/routes/api/list/[[vorgang]]/+server.ts | 34 +++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/routes/api/list/[[vorgang]]/+server.ts b/src/routes/api/list/[[vorgang]]/+server.ts index 5a76090..cdd1b92 100644 --- a/src/routes/api/list/[[vorgang]]/+server.ts +++ b/src/routes/api/list/[[vorgang]]/+server.ts @@ -1,24 +1,24 @@ -import { client } from '$lib/minio'; +// import { client } from '$lib/minio'; -export async function DELETE({ params }) { - const vorgang = params.vorgang; +// export async function DELETE({ params }) { +// const vorgang = params.vorgang; - const object_list = await new Promise((resolve, reject) => { - const res = []; - const items_str = client.listObjects('tatort', vorgang, true); +// const object_list = await new Promise((resolve, reject) => { +// const res = []; +// const items_str = client.listObjects('tatort', vorgang, true); - items_str.on('data', (obj) => { - res.push(obj.name); - }); +// items_str.on('data', (obj) => { +// res.push(obj.name); +// }); - items_str.on('error', reject); +// items_str.on('error', reject); - items_str.on('end', async () => { - resolve(res); - }); - }); +// items_str.on('end', async () => { +// resolve(res); +// }); +// }); - await client.removeObjects('tatort', object_list); +// await client.removeObjects('tatort', object_list); - return new Response(null, { status: 204 }); -} +// return new Response(null, { status: 204 }); +// } From bb5ade22c66c5824f08767601707e857aad4e0af Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:39:38 +0200 Subject: [PATCH 10/37] test jenkins pipeline --- Jenkinsfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ea12da3..3ba8407 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,17 +5,17 @@ pipeline { nodejs 'NodeJS-24.2.0' } - environment { - REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/' - IMAGE = 'tatort-app' - USER = 'jared' - TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') - } + // environment { + // REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/' + // IMAGE = 'tatort-app' + // USER = 'jared' + // TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') + // } - parameters { - string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') - string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref') - } + // parameters { + // string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') + // string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref') + // } options { buildDiscarder( From 2d003a619fd78bceb826ed80d02c303daf85311c Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:44:28 +0200 Subject: [PATCH 11/37] set audit level to moderate --- Jenkinsfile | 2 +- src/routes/api/list/[[vorgang]]/+server.ts | 34 +++++++++++----------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3ba8407..0d479a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -36,7 +36,7 @@ pipeline { stage('Test & Security Audit') { steps { echo 'Start checking security vulnerabilities in npm packages' - sh 'npm audit' + sh 'npm audit --audit-level=moderate' } } diff --git a/src/routes/api/list/[[vorgang]]/+server.ts b/src/routes/api/list/[[vorgang]]/+server.ts index cdd1b92..5a76090 100644 --- a/src/routes/api/list/[[vorgang]]/+server.ts +++ b/src/routes/api/list/[[vorgang]]/+server.ts @@ -1,24 +1,24 @@ -// import { client } from '$lib/minio'; +import { client } from '$lib/minio'; -// export async function DELETE({ params }) { -// const vorgang = params.vorgang; +export async function DELETE({ params }) { + const vorgang = params.vorgang; -// const object_list = await new Promise((resolve, reject) => { -// const res = []; -// const items_str = client.listObjects('tatort', vorgang, true); + const object_list = await new Promise((resolve, reject) => { + const res = []; + const items_str = client.listObjects('tatort', vorgang, true); -// items_str.on('data', (obj) => { -// res.push(obj.name); -// }); + items_str.on('data', (obj) => { + res.push(obj.name); + }); -// items_str.on('error', reject); + items_str.on('error', reject); -// items_str.on('end', async () => { -// resolve(res); -// }); -// }); + items_str.on('end', async () => { + resolve(res); + }); + }); -// await client.removeObjects('tatort', object_list); + await client.removeObjects('tatort', object_list); -// return new Response(null, { status: 204 }); -// } + return new Response(null, { status: 204 }); +} From 739f67169e163d14be643cdf93877d2e2761c5ab Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 07:57:05 +0200 Subject: [PATCH 12/37] added confi for dev and prod --- Dockerfile.dev | 2 +- Dockerfile.prod | 2 +- config dev.json | 17 +++++++++++++++++ config.json => config prod.json | 4 ++-- 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 config dev.json rename config.json => config prod.json (94%) diff --git a/Dockerfile.dev b/Dockerfile.dev index 81e9c36..3a1a399 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -6,7 +6,7 @@ WORKDIR /app COPY package*.json ./ RUN npm ci COPY . ./ -COPY config.json_dev ./config.json +COPY config_dev.json ./config.json RUN npm run build # --- Production stage --- diff --git a/Dockerfile.prod b/Dockerfile.prod index 2d92413..66a3f39 100644 --- a/Dockerfile.prod +++ b/Dockerfile.prod @@ -6,7 +6,7 @@ WORKDIR /app COPY package*.json ./ RUN npm ci COPY . ./ -COPY config.json_prod ./config.json +COPY config_prod.json ./config.json RUN npm run build # --- Production stage --- diff --git a/config dev.json b/config dev.json new file mode 100644 index 0000000..8ab9cb8 --- /dev/null +++ b/config dev.json @@ -0,0 +1,17 @@ +{ + "minio": { + "endPoint": "sws3.innovation-hub-niedersachsen.de", + "port": 443, + "useSSL": true, + "accessKey": "wjpKrmaqXra99rX3D61H", + "secretKey": "fTPi0u0FR6Lv9Y9IKydWv6WM0EA5XrsK008HCt9u" + }, + "jwt": { + "secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB", + "expiresIn": 3600 + }, + "auth": { + "admin": { "password": "A-InnoHUB_2025!", "admin": true }, + "user": { "password": "U-InnoHUB_2025!", "admin": false } + } +} \ No newline at end of file diff --git a/config.json b/config prod.json similarity index 94% rename from config.json rename to config prod.json index 8490de6..126d80d 100644 --- a/config.json +++ b/config prod.json @@ -8,10 +8,10 @@ }, "jwt": { "secret": "@S2!q@@wXz$dCQ8JoVsHLpzaJ6JCfB", - "expiresIn": 36000 + "expiresIn": 3600 }, "auth": { "admin": { "password": "A-InnoHUB_2025!", "admin": true }, "user": { "password": "U-InnoHUB_2025!", "admin": false } } -} +} \ No newline at end of file From 517654bfbf2f3445c777a30af93256ce48900187 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:00:16 +0200 Subject: [PATCH 13/37] fixed config names --- config dev.json => config_dev.json | 0 config prod.json => config_prod.json | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename config dev.json => config_dev.json (100%) rename config prod.json => config_prod.json (100%) diff --git a/config dev.json b/config_dev.json similarity index 100% rename from config dev.json rename to config_dev.json diff --git a/config prod.json b/config_prod.json similarity index 100% rename from config prod.json rename to config_prod.json From 3bd369c9e2954b01315031f9a34befde3a5a1881 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:13:51 +0200 Subject: [PATCH 14/37] added params --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d479a4..6d88774 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,10 +12,10 @@ pipeline { // TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') // } - // parameters { - // string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') - // string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref') - // } + parameters { + string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') + string(name: 'GIT_REF', defaultValue: '', description: 'Git Ref') + } options { buildDiscarder( @@ -44,8 +44,9 @@ pipeline { steps { echo 'Start Pushing' script { + def tag = "innohub/tatort:${env.BUILD_ID}-dev" docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { - docker.build("innohub/tatort:${env.BUILD_ID}", '-f Dockerfile.dev .').push('latest') + docker.build(tag, '-f Dockerfile.dev .').push() } } } From 29398698161c15396c55cdeae02259e3e9ad6475 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:29:26 +0200 Subject: [PATCH 15/37] renamed image tag --- Jenkinsfile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d88774..817e3de 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,6 @@ pipeline { // environment { // REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/' - // IMAGE = 'tatort-app' // USER = 'jared' // TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') // } @@ -44,7 +43,7 @@ pipeline { steps { echo 'Start Pushing' script { - def tag = "innohub/tatort:${env.BUILD_ID}-dev" + def tag = "innohub/tatort-dev:${env.BUILD_ID}" docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { docker.build(tag, '-f Dockerfile.dev .').push() } @@ -53,15 +52,6 @@ pipeline { } } - // stage('Build') { - // when { - // branch 'development' - // } - // steps { - // sh 'npm run build' - // } - // } - post { success { echo 'Pipeline erfolgreich!' From abd756462b6fc710877b62434a110d65b80dcd6b Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:47:45 +0200 Subject: [PATCH 16/37] post statement only if changes --- Jenkinsfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 96b1d48..b5e4889 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -63,14 +63,17 @@ pipeline { // } post { - success { - echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } + def hasChanges = currentBuild?.rawBuild?.changeSets?.any { it.items && it.items.length > 0 } + if (hasChanges) { + success { + echo 'Pipeline erfolgreich!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } - failure { - echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + failure { + echo 'Pipeline fehlgeschlagen!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } } } } From 7ca8b295db9722a3309b46735cfabac8c4bc1a34 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:53:31 +0200 Subject: [PATCH 17/37] no post statement --- Jenkinsfile | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5e4889..8b23f23 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,18 +62,14 @@ pipeline { // } // } - post { - def hasChanges = currentBuild?.rawBuild?.changeSets?.any { it.items && it.items.length > 0 } - if (hasChanges) { - success { - echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } - - failure { - echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } - } - } + // post { + // success { + // echo 'Pipeline erfolgreich!' + // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + // } + // failure { + // echo 'Pipeline fehlgeschlagen!' + // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + // } + // } } From 0235b566374ebfbcb204845a8de9358351e5895f Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:55:53 +0200 Subject: [PATCH 18/37] deactivte post message --- Jenkinsfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 817e3de..12a3eea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,15 +52,15 @@ pipeline { } } - post { - success { - echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } + // post { + // success { + // echo 'Pipeline erfolgreich!' + // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + // } - failure { - echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } - } + // failure { + // echo 'Pipeline fehlgeschlagen!' + // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + // } + // } } From 22fc1f490c2a76d5ca176bef32e70c5397eec90f Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 08:58:09 +0200 Subject: [PATCH 19/37] activate post message --- Jenkinsfile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12a3eea..817e3de 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -52,15 +52,15 @@ pipeline { } } - // post { - // success { - // echo 'Pipeline erfolgreich!' - // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - // } + post { + success { + echo 'Pipeline erfolgreich!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } - // failure { - // echo 'Pipeline fehlgeschlagen!' - // discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - // } - // } + failure { + echo 'Pipeline fehlgeschlagen!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } + } } From 93be24a8de61f55a3f17bb6cbdc5ddc5368263b5 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:19:09 +0200 Subject: [PATCH 20/37] added check if pipeline job was running --- Jenkinsfile | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 817e3de..95efcf4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +def runJobs = false + pipeline { agent any @@ -30,6 +32,9 @@ pipeline { steps { sh 'npm ci' } + post { + runJobs = true + } } stage('Test & Security Audit') { @@ -37,30 +42,37 @@ pipeline { echo 'Start checking security vulnerabilities in npm packages' sh 'npm audit --audit-level=moderate' } + post { + runJobs = true + } } stage('Push image to gitea registry') { steps { - echo 'Start Pushing' script { - def tag = "innohub/tatort-dev:${env.BUILD_ID}" + def tag = "innohub/tatort-dev:0.${env.BUILD_ID}" docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { docker.build(tag, '-f Dockerfile.dev .').push() } } + post { + runJobs = true + } } } } post { - success { - echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' - } + if (runJobs) { + success { + echo 'Pipeline erfolgreich!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } - failure { - echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + failure { + echo 'Pipeline fehlgeschlagen!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } } } } From 49907da1b16f11fa4d9bb87d74f94123093dcb3b Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:21:44 +0200 Subject: [PATCH 21/37] added check if pipeline job was running --- Jenkinsfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95efcf4..b523cfa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -def runJobs = false +def didRun = false pipeline { agent any @@ -29,41 +29,39 @@ pipeline { stages { stage('Install Dependencies') { + script { + didRun = true + } steps { sh 'npm ci' } - post { - runJobs = true - } } stage('Test & Security Audit') { + script { + didRun = true + } steps { echo 'Start checking security vulnerabilities in npm packages' sh 'npm audit --audit-level=moderate' } - post { - runJobs = true - } } stage('Push image to gitea registry') { steps { script { + didRun = true def tag = "innohub/tatort-dev:0.${env.BUILD_ID}" docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { docker.build(tag, '-f Dockerfile.dev .').push() } } - post { - runJobs = true - } } } } post { - if (runJobs) { + if (didRun) { success { echo 'Pipeline erfolgreich!' discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' From 95a9364391ba438cffb1210ae648e4f97d9f3dd3 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:25:21 +0200 Subject: [PATCH 22/37] added check if pipeline job was running --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b523cfa..f3d4456 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,19 +29,19 @@ pipeline { stages { stage('Install Dependencies') { - script { - didRun = true - } steps { + script { + didRun = true + } sh 'npm ci' } } stage('Test & Security Audit') { - script { - didRun = true - } steps { + script { + didRun = true + } echo 'Start checking security vulnerabilities in npm packages' sh 'npm audit --audit-level=moderate' } From c25c8498f33cbea76c2f141644d5f391c8871068 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:49:43 +0200 Subject: [PATCH 23/37] added check if pipeline job was running --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index f3d4456..cb7e4fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,6 +62,7 @@ pipeline { post { if (didRun) { + success { echo 'Pipeline erfolgreich!' discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' From eee820b39ed0d58ff1c050555c97b985731cb0c9 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:52:45 +0200 Subject: [PATCH 24/37] added check if pipeline job was running --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb7e4fd..f3d4456 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,6 @@ pipeline { post { if (didRun) { - success { echo 'Pipeline erfolgreich!' discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' From b57a30338ec36822946e2c830304ec623520e61e Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:56:01 +0200 Subject: [PATCH 25/37] added check if pipeline job was running --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index f3d4456..cb7e4fd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,6 +62,7 @@ pipeline { post { if (didRun) { + success { echo 'Pipeline erfolgreich!' discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' From 2ad9e5d86d3716f6691f82619cbf303453624389 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 09:58:38 +0200 Subject: [PATCH 26/37] added check if pipeline job was running --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb7e4fd..f3d4456 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,6 @@ pipeline { post { if (didRun) { - success { echo 'Pipeline erfolgreich!' discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' From 0aa03aea1932d3ccc9c2a78dca47c27ea366f6aa Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 12:39:24 +0200 Subject: [PATCH 27/37] fix pipeline --- Jenkinsfile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f3d4456..4811a4e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,15 +61,20 @@ pipeline { } post { - if (didRun) { - success { - echo 'Pipeline erfolgreich!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + success { + script { + if (didRun) { + echo 'Pipeline erfolgreich!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline succeeded', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } } - - failure { - echo 'Pipeline fehlgeschlagen!' - discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } + failure { + script { + if (didRun) { + echo 'Pipeline fehlgeschlagen!' + discordSend description: "Running ${env.BUILD_ID} on ${env.JENKINS_URL}, ${params.GIT_REF}", footer: 'Pipeline failed', link: env.BUILD_URL, result: currentBuild.currentResult, title: env.JOB_NAME, webhookURL: 'https://discordapp.com/api/webhooks/1389470542691831819/NdMO17sLBG2dplp_-oh6Ff0cbPOoADl0QwXKM9UzduxU44av_ZQkQjKTmpdK7YuwcZDc' + } } } } From 0de66fe533b2a9ba8594e248769f79644dd0ac19 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 12:50:17 +0200 Subject: [PATCH 28/37] get gitea json object --- Jenkinsfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 4811a4e..b85e83f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,6 +27,25 @@ pipeline { ) } + stages { + stage('Lade Konfiguration') { + steps { + script { + @Library('InnoHub-Library@master') + + // z. B. Methode in Library: getRepoConfig(repo, ref) + def repoConfig = getRepoConfig(REPO_NAME, GIT_REF) + + echo "Gefunden: ${repoConfig.name}, Branch: ${repoConfig.branch}" + + echo repoConfig + + def jobsToTrigger = repoConfig.jobs + } + } + } + } + stages { stage('Install Dependencies') { steps { From 0622fce790469cfe219bd120751b29c5c4ad5277 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 12:51:42 +0200 Subject: [PATCH 29/37] get gitea json object --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index b85e83f..d064352 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,7 +39,7 @@ pipeline { echo "Gefunden: ${repoConfig.name}, Branch: ${repoConfig.branch}" echo repoConfig - + def jobsToTrigger = repoConfig.jobs } } From 45644c9695bf9cfbdbde51f9cf91df2e2ecfea1a Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 12:53:19 +0200 Subject: [PATCH 30/37] get gitea json object --- Jenkinsfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d064352..a1b959d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,8 +39,6 @@ pipeline { echo "Gefunden: ${repoConfig.name}, Branch: ${repoConfig.branch}" echo repoConfig - - def jobsToTrigger = repoConfig.jobs } } } From 32d6245b5accc8beaa6d41d88fcc0f879e6a9c11 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 12:54:25 +0200 Subject: [PATCH 31/37] get gitea json object --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a1b959d..e244c67 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,9 +42,7 @@ pipeline { } } } - } - - stages { + stage('Install Dependencies') { steps { script { @@ -70,7 +68,7 @@ pipeline { didRun = true def tag = "innohub/tatort-dev:0.${env.BUILD_ID}" docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { - docker.build(tag, '-f Dockerfile.dev .').push() + docker.build(tag, '-f Dockerfile.dev .').push('latest') } } } From 7a25dbf68cf90ebfe1137b748cd1e459612d7b8f Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 13:07:02 +0200 Subject: [PATCH 32/37] change gitea user --- Jenkinsfile | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e244c67..de7e3e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,11 +7,11 @@ pipeline { nodejs 'NodeJS-24.2.0' } - // environment { - // REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/' - // USER = 'jared' - // TOKEN = credentials('c661e484bb4f032f8a0a5b02cda6f3344ca584b5') - // } + environment { + REGISTRY = 'https://gitea.innovation-hub-niedersachsen.de/' + USER = 'jenkins' + TOKEN = credentials('JenkinsGitea') + } parameters { string(name: 'REPO_NAME', defaultValue: '', description: 'Repo Name') @@ -28,21 +28,6 @@ pipeline { } stages { - stage('Lade Konfiguration') { - steps { - script { - @Library('InnoHub-Library@master') - - // z. B. Methode in Library: getRepoConfig(repo, ref) - def repoConfig = getRepoConfig(REPO_NAME, GIT_REF) - - echo "Gefunden: ${repoConfig.name}, Branch: ${repoConfig.branch}" - - echo repoConfig - } - } - } - stage('Install Dependencies') { steps { script { From b843e3abc0078a14672fe7e35890d3b5f1606437 Mon Sep 17 00:00:00 2001 From: Jared Date: Tue, 1 Jul 2025 13:11:36 +0200 Subject: [PATCH 33/37] push docker image only in dev branch --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index de7e3e8..eba846e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,6 +48,9 @@ pipeline { } stage('Push image to gitea registry') { + when { + branch 'development' + } steps { script { didRun = true From e9eb2c1163b16a49923304292ce6998be2d22c44 Mon Sep 17 00:00:00 2001 From: Daniel Mann Date: Wed, 2 Jul 2025 07:41:05 +0200 Subject: [PATCH 34/37] Update Jenkinsfile --- Jenkinsfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index eba846e..5e0d151 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,6 +28,24 @@ pipeline { } stages { + stage('Validate Run Parameters') { + steps { + script { + def jobParts = env.JOB_NAME.tokenize('/') + def detectedRepo = jobParts[1] + + echo "Detected Repo: ${detectedRepo}" + echo "Provided REPO_NAME: ${params.REPO_NAME}" + + if (params.REPO_NAME != detectedRepo) { + echo "Skipping build. REPO_NAME '${params.REPO_NAME}' does not match repo '${detectedRepo}'" + currentBuild.result = 'NOT_BUILT' + error("Stopping pipeline as REPO_NAME does not match repository.") + } + } + } + } + stage('Install Dependencies') { steps { script { From b63834eb5121d502f96e9763fd91256cf6a84a69 Mon Sep 17 00:00:00 2001 From: Daniel Mann Date: Wed, 2 Jul 2025 07:52:09 +0200 Subject: [PATCH 35/37] Update Jenkinsfile --- Jenkinsfile | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e0d151..12f7d92 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,5 @@ +@Library('InnoHub-Library') _ + def didRun = false pipeline { @@ -28,20 +30,10 @@ pipeline { } stages { - stage('Validate Run Parameters') { + stage('Validate Repository') { steps { script { - def jobParts = env.JOB_NAME.tokenize('/') - def detectedRepo = jobParts[1] - - echo "Detected Repo: ${detectedRepo}" - echo "Provided REPO_NAME: ${params.REPO_NAME}" - - if (params.REPO_NAME != detectedRepo) { - echo "Skipping build. REPO_NAME '${params.REPO_NAME}' does not match repo '${detectedRepo}'" - currentBuild.result = 'NOT_BUILT' - error("Stopping pipeline as REPO_NAME does not match repository.") - } + checkRepoName(params.REPO_NAME) } } } From f0df67fb86dff560f63a7f01b2517ffb3dfccc20 Mon Sep 17 00:00:00 2001 From: Daniel Mann Date: Wed, 2 Jul 2025 08:12:56 +0200 Subject: [PATCH 36/37] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12f7d92..2035c83 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,7 +33,7 @@ pipeline { stage('Validate Repository') { steps { script { - checkRepoName(params.REPO_NAME) + checkRepoName(params.REPO_NAME, true) //@jared: The "true" means, do not build PR's! } } } From 5f996e70072d67f4a63faa1b7d2e3cd47e11de1b Mon Sep 17 00:00:00 2001 From: Jared Date: Fri, 4 Jul 2025 10:09:06 +0200 Subject: [PATCH 37/37] added sonar to pipeline --- Jenkinsfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index eba846e..6d2f479 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,7 @@ -def didRun = false +/* groovylint-disable-next-line UnusedVariable */ +@Library('InnoHub-Library') _ + +Boolean didRun = false pipeline { agent any @@ -28,6 +31,14 @@ pipeline { } stages { + stage('Validate Repository') { + steps { + script { + checkRepoName(params.REPO_NAME, true) + } + } + } + stage('Install Dependencies') { steps { script { @@ -47,6 +58,14 @@ pipeline { } } + stage('SonarQube Analysis') { + steps { + withSonarQubeEnv('sonarqube') { + sh 'sonar-scanner -Dsonar.projectKey=tatort -Dsonar.sources=src' + } + } + } + stage('Push image to gitea registry') { when { branch 'development'