Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Candlepin pipeline #361

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 0 additions & 2 deletions theforeman.org/pipelines/lib/release.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ void push_staging_rpms(repo_src, repo_dest, version, distro, keep_old_files = fa
destination = "releases/${version}/${distro}"
} else if (repo_dest == 'katello') {
destination = "katello/${version}/katello/${distro}"
} else if (repo_dest == 'candlepin') {
destination = "katello/${version}/candlepin/${distro}"
} else {
destination = "${repo_dest}/${version}/${distro}"
}
Expand Down
67 changes: 67 additions & 0 deletions theforeman.org/pipelines/release/pipelines/candlepin.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
pipeline {
agent { label 'el8' }

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

stages {
stage('staging-build-repository') {
when {
expression { candlepin_version == 'nightly' }
}
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') {
when {
expression { candlepin_version == 'nightly' }
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('candlepin', 'candlepin', candlepin_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
parallel repoclosures('candlepin', candlepin_distros, candlepin_version)
}
}
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