pnut-bridge/Jenkinsfile

36 lines
1.5 KiB
Text
Raw Normal View History

2023-11-10 21:02:56 +00:00
pipeline {
agent none
environment {
CHAT = "devel@conference.mcmillian.dev"
MAIL = "morgan@mcmillian.dev"
}
stages {
stage('Build docker image') {
agent { label 'docker-build' }
environment {
TAG = "${env.BRANCH_NAME == "main" ? "latest" : env.BRANCH_NAME}"
}
steps {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}"
script {
2024-09-08 19:36:06 +00:00
docker.withRegistry('https://git.dreamfall.space/spacenerdmo', 'spacenerdmo-pkg-pub') {
def customImage = docker.build("git.dreamfall.space/spacenerdmo/pnut-bridge:${TAG}")
2023-11-10 21:02:56 +00:00
customImage.push()
}
}
}
post {
success {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Succeeded', notifySuspects: true, targets: "${CHAT}"
}
failure {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Failed', notifySuspects: true, targets: "${CHAT}"
mail to: "${MAIL}",
subject: "Build Failed: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
}
}
}
}
}