From 4a4295e1a2ba8480a09b32f934004e8296cd0ff2 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 23 Nov 2025 11:42:55 -0600 Subject: [PATCH] wip: ci: use fedoraBuild --- ci/Jenkinsfile | 150 +++++++++++++++++++------------------------------ 1 file changed, 59 insertions(+), 91 deletions(-) diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile index 801ac52..a4033a6 100644 --- a/ci/Jenkinsfile +++ b/ci/Jenkinsfile @@ -1,7 +1,7 @@ -pipeline { - agent none +@Library('dch@fedora')_ - triggers { +properties([ + pipelineTriggers([ GenericTrigger( causeString: 'Webhook Trigger', genericVariables: [[ @@ -15,100 +15,68 @@ pipeline { silentResponse: true, tokenCredentialId: 'webhook-trigger', ) - } + ]) +]) - stages { - stage('RPM') { - matrix { - axes { - axis { - name 'FEDORA' - values '41', '42' - } - } - - agent { - kubernetes { - yamlFile 'ci/podTemplate.yaml' - yamlMergeStrategy merge() - defaultContainer 'fedora' - containerTemplate { - name 'fedora' - image "registry.fedoraproject.org/fedora:${FEDORA}" - } - } - } - - stages { - stage('Prepare') { - steps { - sh '. ci/prepare.sh' - } - } - - stage('Build') { - steps { - withCredentials([file( - credentialsId: 'kmod-signing-cert', - variable: 'SIGNING_KEY', - )]) { - sh '. ci/build.sh' - } - } - } - - stage('Sign') { - when { - branch 'main' - } - environment { - GNUPGHOME = "${env.WORKSPACE_TMP}/gnupg" - } - steps { - withCredentials([ - file( - credentialsId: 'rpm-gpg-key', - variable: 'RPM_GPG_PRIVATE_KEY', - ), - file( - credentialsId: 'rpm-gpg-key-passphrase', - variable: 'RPM_GPG_KEY_PASSPHRASE', - ), - ]) { - sh '. ci/sign.sh' - } - } - } - - stage('Archive') { - steps { - archiveArtifacts '*.rpm' - } - } - - stage('Publish') { - when { - branch 'main' - } - steps { - sshagent(['jenkins-repohost']) { - sh '. ci/publish.sh' - } - } - } +fedoraBuild { + try { + stage('Prepare') { + container('build') { + sh '. ci/prepare.sh' + } + } + stage('Build') { + withCredentials([file( + credentialsId: 'kmod-signing-cert', + variable: 'SIGNING_KEY', + )]) { + container('build') { + sh '. ci/build.sh' } } } - } - post { - failure { - emailext( - to: 'gyrfalcon@ebonfire.com', - subject: '$DEFAULT_SUBJECT', - body: '$DEFAULT_CONTENT', - ) + stage('Sign') { + when { + branch 'main' + } + withEnvironment([ + "GNUPGHOME="${env.WORKSPACE_TMP}/gnupg", + ]) { + withCredentials([ + file( + credentialsId: 'rpm-gpg-key', + variable: 'RPM_GPG_PRIVATE_KEY', + ), + file( + credentialsId: 'rpm-gpg-key-passphrase', + variable: 'RPM_GPG_KEY_PASSPHRASE', + ), + ]) { + sh '. ci/sign.sh' + } + } } + + archiveArtifacts '*.rpm' + + stage('Publish') { + when { + branch 'main' + } + container('build') { + sshagent(['jenkins-repohost']) { + sh '. ci/publish.sh' + } + } + } + + } catch (ex) { + emailext( + to: 'gyrfalcon@ebonfire.com', + subject: '$DEFAULT_SUBJECT', + body: '$DEFAULT_CONTENT', + ) } }