jenkins-mercurial/Jenkinsfile

36 lines
1.5 KiB
Text
Raw Permalink Normal View History

2024-08-09 14:56:49 +00:00
pipeline {
agent none
environment {
CHAT = "spacenerdmo@clacks.network"
2024-09-08 18:32:08 +00:00
MAIL = "morgan@mcmillian.dev"
2024-08-09 14:56:49 +00:00
}
stages {
stage('Build docker image') {
2024-08-09 16:25:54 +00:00
agent { label 'docker-build' }
2024-08-09 14:56:49 +00:00
environment {
TAG = "lts"
}
steps {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}"
script {
2024-09-08 18:32:08 +00:00
docker.withRegistry('https://git.dreamfall.space/spacenerdmo', 'spacenerdmo-pkg-pub') {
def customImage = docker.build("git.dreamfall.space/spacenerdmo/jenkins-mercurial:${TAG}")
2024-08-09 14:56:49 +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}"
2024-09-08 18:32:08 +00:00
mail to: "${MAIL}",
subject: "Deploy Failed: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
2024-08-09 14:56:49 +00:00
}
}
}
}
}