clacksme/Jenkinsfile

36 lines
1.5 KiB
Text
Raw Permalink Normal View History

2022-12-28 15:38:52 +00:00
pipeline {
agent none
2023-11-10 20:47:03 +00:00
environment {
2024-09-08 19:21:02 +00:00
CHAT = "spacenerdmo@clacks.network"
2023-11-10 20:47:03 +00:00
MAIL = "morgan@mcmillian.dev"
}
2022-12-28 15:38:52 +00:00
stages {
stage('Build docker image') {
agent { label 'docker-build' }
2023-11-10 20:47:03 +00:00
environment {
TAG = "${env.BRANCH_NAME == "main" ? "latest" : env.BRANCH_NAME}"
}
2022-12-28 15:38:52 +00:00
steps {
2023-11-10 20:47:03 +00:00
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}"
2022-12-28 15:38:52 +00:00
script {
2024-09-08 19:21:02 +00:00
docker.withRegistry('https://git.dreamfall.space/spacenerdmo', 'spacenerdmo-pkg-pub') {
def customImage = docker.build("git.dreamfall.space/spacenerdmo/clacksme:${TAG}")
2022-12-28 15:38:52 +00:00
customImage.push()
}
}
}
2023-11-10 20:47:03 +00:00
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}"
2023-11-10 20:48:44 +00:00
mail to: "${MAIL}",
subject: "Build Failed: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
2023-11-10 20:47:03 +00:00
}
}
2022-12-28 15:38:52 +00:00
}
}
}