From 6117b0a28d672c1d7a0ac89b45305ef6216d61f0 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 11 Sep 2024 15:31:11 -0700 Subject: [PATCH] initial commit --- Dockerfile | 8 ++++++++ Jenkinsfile | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..16063e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM docker.io/library/caddy:builder AS builder + +RUN xcaddy build \ + --with github.com/caddy-dns/linode + +FROM docker.io/library/caddy:latest + +COPY --from=builder /usr/bin/caddy /usr/bin/caddy diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..94b96b8 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent none + environment { + CHAT = "spacenerdmo@clacks.network" + MAIL = "morgan@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/spacenerdmo', 'spacenerdmo-pkg-pub') { + def customImage = docker.build("git.dreamfall.space/spacenerdmo/caddy:${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}" + mail to: "${MAIL}", + subject: "Deploy Failed: ${currentBuild.fullDisplayName}", + body: "Something is wrong with ${env.BUILD_URL}" + } + } + } + } +}