wip: ci: Add Jenkins build pipeline
All checks were successful
infra/dch-autoprovision/pipeline/head This commit looks good
All checks were successful
infra/dch-autoprovision/pipeline/head This commit looks good
This commit is contained in:
84
ci/Jenkinsfile
vendored
Normal file
84
ci/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
pipeline {
|
||||
agent none
|
||||
|
||||
stages {
|
||||
stage('RPM') {
|
||||
matrix {
|
||||
axes {
|
||||
axis {
|
||||
name 'ARCH'
|
||||
values 'amd64', 'arm64'
|
||||
}
|
||||
axis {
|
||||
name 'FEDORA'
|
||||
values '41', '42'
|
||||
}
|
||||
}
|
||||
|
||||
agent {
|
||||
kubernetes {
|
||||
yamlFile 'ci/podTemplate.yaml'
|
||||
yamlMergeStrategy merge()
|
||||
defaultContainer 'build'
|
||||
nodeSelector "kubernetes.io/arch=${ARCH}"
|
||||
containerTemplate {
|
||||
name 'build'
|
||||
image "registry.fedoraproject.org/fedora:${FEDORA}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
environment {
|
||||
GNUPGHOME = "${env.WORKSPACE_TMP}/gnupg"
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Prepare') {
|
||||
steps {
|
||||
sh '. ci/prepare.sh'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh '. ci/build.sh'
|
||||
script {
|
||||
if (env.BRANCH_NAME == 'master') {
|
||||
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-rpms.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
archiveArtifacts "f${FEDORA}/**/*.rpm"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
sshagent(['jenkins-repohost']) {
|
||||
sh '. ci/publish.sh'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user