added check if pipeline job was running
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
This commit is contained in:
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
def runJobs = false
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
@@ -30,6 +32,9 @@ pipeline {
|
|||||||
steps {
|
steps {
|
||||||
sh 'npm ci'
|
sh 'npm ci'
|
||||||
}
|
}
|
||||||
|
post {
|
||||||
|
runJobs = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Test & Security Audit') {
|
stage('Test & Security Audit') {
|
||||||
@@ -37,22 +42,28 @@ pipeline {
|
|||||||
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 {
|
||||||
echo 'Start Pushing'
|
|
||||||
script {
|
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.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) {
|
||||||
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'
|
||||||
@@ -63,4 +74,5 @@ pipeline {
|
|||||||
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'
|
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'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user