From d6e050ecf90c0b51cc93585b3d4b438be79dec3d Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Fri, 10 Nov 2023 12:47:03 -0800 Subject: [PATCH] switch to jenkins build --- Jenkinsfile | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bc54c3c..1826bb7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,25 +1,35 @@ pipeline { agent none + environment { + CHAT = "devel@conference.mcmillian.dev" + MAIL = "morgan@mcmillian.dev" + } stages { stage('Build docker image') { agent { label 'docker-build' } + environment { + TAG = "${env.BRANCH_NAME == "main" ? "latest" : env.BRANCH_NAME}" + } steps { - // mattermostSend "Docker build started - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" + jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}" script { - docker.withRegistry('https://git.dreamfall.space/thrrgilag', 'docker-gitea-creds') { - def customImage = docker.build("git.dreamfall.space/thrrgilag/clacksme:latest") + docker.withRegistry('https://git.dreamfall.space/thrrgilag', 'thrrgilag-forgejo-pkg') { + def customImage = docker.build("git.dreamfall.space/thrrgilag/prosody:${TAG}") customImage.push() } } } - // post { - // success { - // mattermostSend color: "good", message: "Docker build success - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" - // } - // failure { - // mattermostSend color: "danger", message: "Docker build failure - ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)" - // } - // } + 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}" + mail to: "${MAIL}" + // subject: "Build Failed: ${currentBuild.fullDisplayName}", + // body: "Something is wrong with ${env.BUILD_URL}" + } + } } } }