clacksme/Jenkinsfile

36 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-12-28 15:38:52 +00:00
pipeline {
agent none
2023-11-10 20:47:03 +00:00
environment {
CHAT = "devel@conference.mcmillian.dev"
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 {
2023-11-10 20:47:03 +00:00
docker.withRegistry('https://git.dreamfall.space/thrrgilag', 'thrrgilag-forgejo-pkg') {
2023-11-10 20:51:19 +00:00
def customImage = docker.build("git.dreamfall.space/thrrgilag/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
}
}
}