jenkins-mercurial/Jenkinsfile

36 lines
1.5 KiB
Text
Raw Permalink Normal View History

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