Skip to content

Commit

Permalink
Add Copr jobs for pulpcore-packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Sep 29, 2023
1 parent 92e2f0e commit b2e916b
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
def packages_to_build

pipeline {
agent { label 'rpmbuild' }

options {
timestamps()
timeout(time: 4, unit: 'HOURS')
disableConcurrentBuilds()
ansiColor('xterm')
}

stages {
stage('Clone Packaging') {
steps {
checkout([
$class : 'GitSCM',
branches : [[name: "*/${packaging_branch}"]],
extensions: [[$class: 'CleanCheckout']],
userRemoteConfigs: [
[url: 'https://github.com/theforeman/pulpcore-packaging']
]
])

}
}
stage('Find packages') {
steps {
copyArtifacts(projectName: env.JOB_NAME, optional: true)

script {

if (fileExists('commit')) {

commit = readFile(file: 'commit').trim()
packages_to_build = find_changed_packages("${commit}..HEAD")

} else {

packages_to_build = []

}
}
}
}
stage('Release Build Packages') {
when {
expression { packages_to_build != [] }
}
steps {

setup_obal()

withCredentials([file(credentialsId: 'theforeman-bot-copr', variable: 'copr_config')]) {
obal(
action: "release",
extraVars: [
'build_package_build_system': 'copr',
'build_package_copr_config': copr_config,
],
packages: packages_to_build
)
}

}
}
}

post {
success {
archive_git_hash()
}
failure {
notifyDiscourse(
env,
"${env.JOB_NAME} failed for ${packages_to_build.join(',')}",
"pulpcore packaging release job failed: ${env.BUILD_URL}"
)
}
cleanup {
deleteDir()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,23 @@
- pipelines/lib/git.groovy
- pipelines/lib/ansible.groovy
- pipelines/lib/obal.groovy

- job:
name: pulpcore-packaging-rpm-copr-pr-test
project-type: pipeline
concurrent: true
sandbox: true
properties:
- github:
url: https://github.com/theforeman/pulpcore-packaging
triggers:
- github_pr_rpm_develop:
context: 'rpm-copr'
dsl:
!include-raw:
- pipelines/test/rpm_copr_packaging.groovy
- pipelines/lib/packaging.groovy
- pipelines/lib/copr.groovy
- pipelines/lib/git.groovy
- pipelines/lib/ansible.groovy
- pipelines/lib/obal.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
concurrent: false
properties:
- github:
url: https://github.com/theforeman/pulpcore-packaging
url: https://github.com/thepulpcore/pulpcore-packaging
triggers:
- github
dsl:
Expand All @@ -26,3 +26,31 @@
empty: ''
version:
!include: ../../includes/pulpcore_versions.yaml.inc

- job-template:
name: 'pulpcore-packaging-rpm-copr-{version}-release'
project-type: pipeline
sandbox: true
concurrent: false
properties:
- github:
url: https://github.com/thepulpcore/pulpcore-packaging
triggers:
- github
dsl:
!include-raw:
- 'pipelines/vars/pulpcore/{version}.groovy'
- 'pipelines/release/pulpcore_packaging_rpm_copr_release.groovy{empty}'
- 'pipelines/lib/git.groovy{empty}'
- 'pipelines/lib/ansible.groovy{empty}'
- 'pipelines/lib/obal.groovy{empty}'
- 'pipelines/lib/packaging.groovy{empty}'
- 'pipelines/lib/foreman_infra.groovy{empty}'

- project:
name: pulpcore-packaging-rpm-copr
jobs:
- 'pulpcore-packaging-rpm-copr-{version}-release'
empty: ''
version:
- '3.28'

0 comments on commit b2e916b

Please sign in to comment.