jenkins-docker #17

Merged
jared merged 26 commits from jenkins-docker into development 2025-07-01 13:30:25 +02:00
Showing only changes of commit 49907da1b1 - Show all commits

20
Jenkinsfile vendored
View File

@@ -1,4 +1,4 @@
def runJobs = false def didRun = false
pipeline { pipeline {
agent any agent any
@@ -29,41 +29,39 @@ pipeline {
stages { stages {
stage('Install Dependencies') { stage('Install Dependencies') {
script {
didRun = true
}
steps { steps {
sh 'npm ci' sh 'npm ci'
} }
post {
runJobs = true
}
} }
stage('Test & Security Audit') { stage('Test & Security Audit') {
script {
didRun = true
}
steps { steps {
echo 'Start checking security vulnerabilities in npm packages' echo 'Start checking security vulnerabilities in npm packages'
sh 'npm audit --audit-level=moderate' sh 'npm audit --audit-level=moderate'
} }
post {
runJobs = true
}
} }
stage('Push image to gitea registry') { stage('Push image to gitea registry') {
steps { steps {
script { script {
didRun = true
def tag = "innohub/tatort-dev:0.${env.BUILD_ID}" def tag = "innohub/tatort-dev:0.${env.BUILD_ID}"
docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') { docker.withRegistry('https://gitea.innovation-hub-niedersachsen.de', 'JenkinsGitea') {
docker.build(tag, '-f Dockerfile.dev .').push() docker.build(tag, '-f Dockerfile.dev .').push()
} }
} }
post {
runJobs = true
}
} }
} }
} }
post { post {
if (runJobs) { if (didRun) {
success { success {
echo 'Pipeline erfolgreich!' 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' 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'