partybot/Jenkinsfile

36 lines
1.5 KiB
Text
Raw Permalink Normal View History

2022-11-11 06:30:35 +00:00
pipeline {
agent none
2022-11-13 14:45:56 +00:00
environment {
2024-09-08 19:30:59 +00:00
CHAT = "spacenerdmo@clacks.network"
2024-09-08 19:28:30 +00:00
MAIL = "morgan@mcmillian.dev"
2022-11-29 19:19:51 +00:00
}
2022-11-11 06:30:35 +00:00
stages {
2022-11-30 01:58:57 +00:00
stage('Build docker image') {
agent { label 'docker-build' }
2023-11-10 20:20:57 +00:00
environment {
TAG = "${env.BRANCH_NAME == "main" ? "latest" : env.BRANCH_NAME}"
}
2022-11-30 01:58:57 +00:00
steps {
2023-11-10 20:20:57 +00:00
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}"
2022-11-30 01:58:57 +00:00
script {
2024-09-08 19:28:30 +00:00
docker.withRegistry('https://git.dreamfall.space/spacenerdmo', 'spacenerdmo-pkg-pub') {
def customImage = docker.build("git.dreamfall.space/spacenerdmo/partybot:${TAG}")
2022-11-30 01:58:57 +00:00
customImage.push()
}
}
}
2023-11-10 20:20:57 +00:00
post {
success {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Succeeded', notifySuspects: true, targets: "${CHAT}"
2022-11-13 05:46:30 +00:00
}
2023-11-10 20:20:57 +00:00
failure {
jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Failed', notifySuspects: true, targets: "${CHAT}"
2024-09-08 19:28:30 +00:00
mail to: "${MAIL}",
subject: "Deploy Failed: ${currentBuild.fullDisplayName}",
body: "Something is wrong with ${env.BUILD_URL}"
2022-11-13 05:46:30 +00:00
}
2022-11-13 04:49:18 +00:00
}
2022-11-11 06:30:35 +00:00
}
}
}