Skip to content

Commit

Permalink
Add Copr nightly test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Oct 27, 2023
1 parent d1c4492 commit 1d26169
Show file tree
Hide file tree
Showing 5 changed files with 311 additions and 64 deletions.
142 changes: 110 additions & 32 deletions theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,129 @@ pipeline {
}

stages {
stage('Mash Koji Repositories') {
agent { label 'sshkey' }

steps {
mash('foreman', 'nightly')
stage('koji') {
when {
expression { stage_source == 'koji' }
}
}
stage('Repoclosure') {
agent { label 'el' }
stages {
stage('koji-mash-repositories') {
agent { label 'sshkey' }

steps {
mash('foreman', 'nightly')
}
}
stage('koji-repoclosure') {
agent { label 'el' }

steps {
script {
parallel repoclosures('foreman', foreman_el_releases, foreman_version)
}
}
post {
always {
deleteDir()
}
}
}
stage('koji-install-test') {
agent any

steps {
script {
parallel repoclosures('foreman', foreman_el_releases, foreman_version)
steps {
script {
runDuffyPipeline('foreman-rpm', foreman_version)
}
}
}
stage('koji-push-rpms') {
agent { label 'admin && sshkey' }
steps {
script {
for (release in foreman_el_releases) {
push_rpms_direct("foreman-${foreman_version}/${release}", "${foreman_version}/${release}")
}
}
}
}
}
post {
always {
deleteDir()
failure {
notifyDiscourse(env, 'Foreman RPM nightly pipeline failed:', currentBuild.description)
}
}
}
stage('Install Test') {
agent any
stage('staging') {
agent { label 'el8' }
when {
expression { stage_source == 'stagingyum' }
}
stages {
stage('staging-build-repository') {
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

steps {
script {
runDuffyPipeline('foreman-rpm', foreman_version)
script {
foreman_el_releases.each { distro ->
sh "./build_stage_repository foreman ${foreman_version} ${distro}"
}
}
}
}
}
}
stage('Push RPMs') {
agent { label 'admin && sshkey' }
steps {
script {
for (release in foreman_el_releases) {
push_rpms_direct("foreman-${foreman_version}/${release}", "${foreman_version}/${release}")
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('foreman', 'foreman', foreman_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
def parallelStagesMap = [:]
def name = 'foreman-staging'
foreman_el_releases.each { distro ->
parallelStagesMap[distro] = { repoclosure(name, distro, foreman_version) }
}
parallel parallelStagesMap
}
}
post {
always {
deleteDir()
}
}
}
stage('staging-install-test') {
agent any

steps {
script {
//runDuffyPipeline('foreman-rpm', foreman_version)
echo "RUN TEST PIPELINE"
}
}
}
stage('staging-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
//push_foreman_staging_rpms('client', foreman_version, distro)
echo "PUSH TO PROD"
}
}
}
}
}
}
}
post {
failure {
notifyDiscourse(env, 'Foreman RPM nightly pipeline failed:', currentBuild.description)
post {
failure {
echo "staging yum failed"
}
}
}
}
}

71 changes: 71 additions & 0 deletions theforeman.org/pipelines/release/pipelines/katello-copr.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
pipeline {
agent { label 'el' }

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

stages {
stage('Build stage repository') {
steps {
checkout([
$class : 'GitSCM',
branches : [[name: "*/copr-build-stage-repo"]],
extensions: [[$class: 'CleanCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]],
userRemoteConfigs: [
[url: 'https://github.com/ehelms/foreman-packaging']
]
])

script {
sh "./build_stage_repository.py katello ${katello_version} el8"
sh "./build_stage_repository.py candlepin ${katello_version} el8"
}
}
}
stage('Copy stage repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('katello', katello_version)
rsync_to_yum_stage('candlepin', katello_version)
}
}
}
}
stage('Repoclosure') {
steps {
echo 'Perform repoclosure HERE'
}
}
stage('Install Test') {
agent any

steps {
script {
echo 'Run TEST'
//runDuffyPipeline('katello-rpm-copr', katello_version)
}
}
}
stage('Push RPMs') {
agent { label 'admin && sshkey' }

steps {
echo 'Copy RPMs from stagingyum to yum HERE'
}
}
}
post {
always {
deleteDir()
}
failure {
notifyDiscourse(env, "Foreman Copr RPM ${katello_version} pipeline failed:", currentBuild.description)
}
}
}

141 changes: 110 additions & 31 deletions theforeman.org/pipelines/release/pipelines/katello.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,130 @@ pipeline {
}

stages {
stage('Mash Koji Repositories') {
agent { label 'sshkey' }

steps {
mash("katello", katello_version)
stage('koji') {
when {
expression { stage_source == 'koji' }
}
}
stage('Katello Repoclosure') {
agent { label 'el' }
stages {
stage('koji-mash-repositories') {
agent { label 'sshkey' }

steps {
mash("katello", katello_version)
}
}
stage('koji-repoclosure') {
agent { label 'el' }

steps {
script {
parallel repoclosures('katello', foreman_el_releases, foreman_version)
steps {
script {
parallel repoclosures('katello', foreman_el_releases, foreman_version)
}
}
post {
always {
deleteDir()
}
}
}
stage('koji-install-test') {
agent any

steps {
script {
runDuffyPipeline('katello-rpm', katello_version)
}
}
}
stage('koji-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
push_katello_rpms(katello_version, distro)
}
}
}
}
}
post {
always {
deleteDir()
failure {
notifyDiscourse(env, "Katello ${katello_version} pipeline failed:", currentBuild.description)
}
}
}
stage('Test Suites') {
agent any
stage('staging') {
agent { label 'el8' }
when {
expression { stage_source == 'stagingyum' }
}
stages {
stage('staging-build-repository') {
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

script {
foreman_el_releases.each { distro ->
sh "./build_stage_repository katello ${foreman_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('katello', 'katello', foreman_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
def parallelStagesMap = [:]
def name = 'katello-staging'
foreman_el_releases.each { distro ->
parallelStagesMap[distro] = { repoclosure(name, distro, foreman_version) }
}
parallel parallelStagesMap
}
}
post {
always {
deleteDir()
}
}
}
stage('staging-install-test') {
agent any

steps {
script {
runDuffyPipeline('katello-rpm', katello_version)
steps {
script {
//runDuffyPipeline('foreman-rpm', foreman_version)
echo "RUN TEST PIPELINE"
}
}
}
}
}
stage('Push RPMs') {
agent { label 'admin && sshkey' }
stage('staging-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
push_katello_rpms(katello_version, distro)
steps {
script {
foreman_el_releases.each { distro ->
//push_foreman_staging_rpms('client', foreman_version, distro)
echo "PUSH TO PROD"
}
}
}
}
}
}
}
post {
failure {
notifyDiscourse(env, "Katello ${katello_version} pipeline failed:", currentBuild.description)
post {
failure {
echo "staging yum failed"
}
}
}
}
}
Loading

0 comments on commit 1d26169

Please sign in to comment.