Files
tatort/Jenkinsfile
Jared 30b49029b2
Some checks failed
InnoHub Processor/tatort/pipeline/head There was a failure building this commit
fixed jenkinsfile
2025-07-01 07:29:07 +02:00

76 lines
2.4 KiB
Groovy

pipeline {
agent any
tools {
nodejs 'NodeJS-24.2.0'
}
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')
}
options {
buildDiscarder(
BuildHistoryManager([
[ continueAfterMatch: false, matchAtMost: 5 ],
[ actions: [ DeleteBuild() ] ]
])
)
}
stages {
stage('Install Dependencies') {
steps {
sh 'npm ci'
}
}
stage('Test & Security Audit') {
steps {
echo 'Start checking security vulnerabilities in npm packages'
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') {
// when {
// branch 'development'
// }
// steps {
// sh 'npm run build'
// }
// }
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'
}
}
}