From 313bc6805ea8f4a10d4900fd14d06292f08e731e Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Mon, 25 Aug 2025 23:15:57 -0500 Subject: [PATCH] ci: Always archive artifacts, only publish master Sometimes, I want to see what the built site looks like before publishing it. For that, I'll push changes to a dev branch and let Jenkins build the site as a tarball that I can download, extract, and view locally. Once I am satisfied, I'll merge the dev branch to master, which Jenkins will build and publish to the live site. --- ci/Jenkinsfile | 8 ++++++++ ci/build.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index a70b166..05836f7 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -26,9 +26,17 @@ pipeline { sh '. ci/build.sh' } } + post { + success { + archiveArtifacts 'dustin.web.tar.xz' + } + } } stage('Publish') { + when { + branch 'master' + } steps { container('rsync') { sshagent(['jenkins-web']) { diff --git a/ci/build.sh b/ci/build.sh index 734e263..2ba3c1e 100644 --- a/ci/build.sh +++ b/ci/build.sh @@ -5,3 +5,5 @@ from json import dump import sys dump(load(sys.stdin), sys.stdout) EOF + +tar -cJf dustin.web.tar.xz -C public .