wip: ci: use fedoraBuild
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good

This commit is contained in:
2025-11-23 11:42:55 -06:00
parent 2684e4b814
commit 866065dc37
2 changed files with 63 additions and 91 deletions

152
ci/Jenkinsfile vendored
View File

@@ -1,7 +1,7 @@
pipeline { @Library('dch@fedora')_
agent none
triggers { properties([
pipelineTriggers([
GenericTrigger( GenericTrigger(
causeString: 'Webhook Trigger', causeString: 'Webhook Trigger',
genericVariables: [[ genericVariables: [[
@@ -15,100 +15,72 @@ pipeline {
silentResponse: true, silentResponse: true,
tokenCredentialId: 'webhook-trigger', tokenCredentialId: 'webhook-trigger',
) )
} ])
])
stages { try {
stage('RPM') { fedoraBuild(
matrix { architectures: ['amd64'],
axes { podTemplate: 'ci/podTemplate.yaml',
axis { ) { arch, fedoraVersion ->
name 'FEDORA' stage("Prepare f${fedoraVersion}/${arch}") {
values '41', '42' checkout scm
container('build') {
sh '. ci/prepare.sh'
}
}
stage("Build f${fedoraVersion}/${arch}") {
withCredentials([file(
credentialsId: 'kmod-signing-cert',
variable: 'SIGNING_KEY',
)]) {
container('build') {
sh '. ci/build.sh'
}
}
}
stage("Sign f${fedoraVersion}/${arch}") {
when(BRANCH_NAME == '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'
} }
} }
}
}
agent { archiveArtifacts '*.rpm'
kubernetes {
yamlFile 'ci/podTemplate.yaml' stage("Publish f${fedoraVersion}/${arch}") {
yamlMergeStrategy merge() when(BRANCH_NAME == 'main') {
defaultContainer 'fedora' container('build') {
containerTemplate { sshagent(['jenkins-repohost']) {
name 'fedora' sh '. ci/publish.sh'
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'
}
}
}
}
} }
} }
} }
} catch (ex) {
post { currentBuild.result = 'FAILED'
failure { emailext(
emailext( to: 'gyrfalcon@ebonfire.com',
to: 'gyrfalcon@ebonfire.com', subject: '$DEFAULT_SUBJECT',
subject: '$DEFAULT_SUBJECT', body: '$DEFAULT_CONTENT',
body: '$DEFAULT_CONTENT', )
) throw ex
}
}
} }

View File

@@ -1,6 +1,6 @@
spec: spec:
containers: containers:
- name: fedora - name: build
command: command:
- cat - cat
stdin: true stdin: true