Files
gasket-driver/ci/Jenkinsfile
Dustin C. Hatch bfd826276d
All checks were successful
RPMs/gasket-driver/pipeline/head This commit looks good
fixup! wip: ci: use fedoraBuild
2025-11-23 13:04:19 -06:00

92 lines
2.4 KiB
Groovy

@Library('dch@fedora')_
properties([
pipelineTriggers([
GenericTrigger(
causeString: 'Webhook Trigger',
genericVariables: [[
key: 'nvr',
value: '$[*].builds[*].nvr',
]],
printContributedVariables: true,
printPostContent: true,
regexpFilterExpression: 'kernel-.*',
regexpFilterText: '$nvr',
silentResponse: true,
tokenCredentialId: 'webhook-trigger',
)
])
])
try {
fedoraBuild(architectures: ['amd64']) {
stage('Prepare') {
checkout scm
container('build') {
sh '. ci/prepare.sh'
}
}
stage('Build') {
withCredentials([file(
credentialsId: 'kmod-signing-cert',
variable: 'SIGNING_KEY',
)]) {
container('build') {
sh '. ci/build.sh'
}
}
}
stage('Sign') {
if (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'
}
}
} else {
catchError(
catchInterruptions: false,
buildResult: null,
stageResult: 'NOT_BUILT',
) {
error('skip')
}
}
}
archiveArtifacts '*.rpm'
stage('Publish') {
when(BRANCH_NAME == 'main') {
container('build') {
sshagent(['jenkins-repohost']) {
sh '. ci/publish.sh'
}
}
}
}
}
} catch (ex) {
currentBuild.result = 'FAILED'
emailext(
to: 'gyrfalcon@ebonfire.com',
subject: '$DEFAULT_SUBJECT',
body: '$DEFAULT_CONTENT',
)
throw ex
}