Skip to content

Commit

Permalink
Add Candlepin pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Dec 1, 2023
1 parent 8750ae1 commit 5c196f2
Show file tree
Hide file tree
Showing 6 changed files with 117 additions and 1 deletion.
10 changes: 9 additions & 1 deletion theforeman.org/pipelines/lib/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ def query_rpmspec(specfile, queryformat) {

def repoclosure(repo, dist, version) {
version = version == 'nightly' ? 'develop' : version
git_repo = repo.contains('pulpcore') ? 'pulpcore-packaging' : 'foreman-packaging'

if (repo.contains('pulpcore')) {
git_repo = 'pulpcore-packaging'
} else if (repo.contains('candlepin')) {
git_repo = 'candlepin-packaging'
} else {
git_repo = 'foreman-packaging'
}

ws(dist) {
dir('packaging') {
git url: "https://github.com/theforeman/${git_repo}", branch: "rpm/${version}", poll: false
Expand Down
66 changes: 66 additions & 0 deletions theforeman.org/pipelines/release/pipelines/candlepin.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
pipeline {
agent { label 'el8' }

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

stages {
stage('staging-build-repository') {
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

script {
candlepin_distros.each { distro ->
sh "./build_stage_repository candlepin ${candlepin_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('candlepin', 'candlepin', candlepin_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
def parallelStagesMap = [:]
def name = 'candlepin'
candlepin_distros.each { distro ->
parallelStagesMap[distro] = { repoclosure(name, distro, candlepin_version) }
}
parallel parallelStagesMap
}
}
post {
always {
deleteDir()
}
}
}
stage('staging-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
candlepin_distros.each { distro ->
push_foreman_staging_rpms('candlepin', candlepin_version, distro)
}
}
}
}
}
post {
failure {
notifyDiscourse(env, "Candlepin ${candlepin_version} RPM pipeline failed:", currentBuild.description)
}
}
}
8 changes: 8 additions & 0 deletions theforeman.org/pipelines/vars/candlepin/4.3.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def candlepin_version = '4.3'
def candlepin_distros = ['el8']
def packaging_branch = 'rpm/4.3'
def pipelines = [
'candlepin': [
'centos8-stream'
]
]
8 changes: 8 additions & 0 deletions theforeman.org/pipelines/vars/candlepin/nightly.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def candlepin_version = 'nightly'
def candlepin_distros = ['el8']
def packaging_branch = 'rpm/develop'
def pipelines = [
'candlepin': [
'centos8-stream'
]
]
2 changes: 2 additions & 0 deletions theforeman.org/yaml/includes/candlepin_versions.yaml.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- 'nightly'
- '4.3'
24 changes: 24 additions & 0 deletions theforeman.org/yaml/jobs/pipeline/candlepin-release-pipelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
- job-template:
name: 'candlepin-{version}-rpm-pipeline'
project-type: pipeline
sandbox: true
triggers:
- timed: 'H 21 * * *'
dsl:
!include-raw:
- 'pipelines/vars/candlepin/{version}.groovy'
- 'pipelines/release/pipelines/candlepin.groovy{empty}'
- 'pipelines/lib/rvm.groovy{empty}'
- 'pipelines/lib/ansible.groovy{empty}'
- 'pipelines/lib/obal.groovy{empty}'
- 'pipelines/lib/packaging.groovy{empty}'
- 'pipelines/lib/release.groovy{empty}'
- 'pipelines/lib/foreman_infra.groovy{empty}'

- project:
name: candlepin
jobs:
- 'candlepin-{version}-rpm-pipeline'
empty: ''
version:
!include: ../../includes/candlepin_versions.yaml.inc

0 comments on commit 5c196f2

Please sign in to comment.