From f55a924e36e558c955173689cd8407f1cbc9d46c Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Fri, 10 Nov 2023 11:20:12 -0800 Subject: [PATCH] Add jenkins build file --- Jenkinsfile | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..9d7a7fd --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,31 @@ +pipeline { + agent none + environment { + CHAT = "devel@conference.mcmillian.dev" + } + stages { + stage('Build docker image') { + agent { label 'docker-build' } + environment { + TAG = "${env.BRANCH_NAME == "main" ? "latest" : env.BRANCH_NAME}" + } + steps { + jabberNotify buildToChatNotifier: [$class: 'ExtraMessageOnlyBuildToChatNotifier'], extraMessage: 'Build Started', notifySuspects: true, targets: "${CHAT}" + script { + docker.withRegistry('https://git.dreamfall.space/thrrgilag', 'thrrgilag-forgejo-pkg') { + def customImage = docker.build("git.dreamfall.space/thrrgilag/prosody:${TAG}") + 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}" + } + } + } + } +}