diff --git a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy index bf87a412..bf9a4237 100644 --- a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy +++ b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy @@ -9,42 +9,114 @@ 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 { - script { - parallel repoclosures('foreman', foreman_el_releases, foreman_version) + steps { + mash('foreman', 'nightly') + } } - } - post { - always { - deleteDir() + stage('koji-repoclosure') { + agent { label 'el' } + + steps { + script { + parallel repoclosures('foreman', foreman_el_releases, foreman_version) + } + } + post { + always { + deleteDir() + } + } } - } - } - stage('Install Test') { - agent any + stage('koji-install-test') { + agent any - steps { - script { - runDuffyPipeline('foreman-rpm', 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}") + } + } + } } } } - 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') { + 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 foreman ${foreman_version} ${distro}" + } + } + } + } + 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) + } + } + } + stage('staging-push-rpms') { + agent { label 'admin && sshkey' } + + steps { + script { + foreman_el_releases.each { distro -> + push_foreman_staging_rpms('foreman', foreman_version, distro) + } + } } } } @@ -56,4 +128,3 @@ pipeline { } } } - diff --git a/theforeman.org/pipelines/release/pipelines/katello.groovy b/theforeman.org/pipelines/release/pipelines/katello.groovy index 83dec683..99a37f22 100644 --- a/theforeman.org/pipelines/release/pipelines/katello.groovy +++ b/theforeman.org/pipelines/release/pipelines/katello.groovy @@ -9,43 +9,115 @@ 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 { - script { - parallel repoclosures('katello', foreman_el_releases, foreman_version) + steps { + mash("katello", katello_version) + } } - } - post { - always { - deleteDir() + stage('koji-repoclosure') { + agent { label 'el' } + + steps { + script { + parallel repoclosures('katello', foreman_el_releases, foreman_version) + } + } + post { + always { + deleteDir() + } + } } - } - } - stage('Test Suites') { - agent any + stage('koji-install-test') { + agent any + + steps { + script { + runDuffyPipeline('katello-rpm', katello_version) + } + } + } + stage('koji-push-rpms') { + agent { label 'admin && sshkey' } - steps { - script { - runDuffyPipeline('katello-rpm', katello_version) + steps { + script { + foreman_el_releases.each { distro -> + push_katello_rpms(katello_version, distro) + } + } + } } } } - stage('Push RPMs') { - agent { label 'admin && sshkey' } + 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 ${katello_version} ${distro}" + } + } + } + } + stage('staging-copy-repository') { + steps { + script { + dir('tmp') { + rsync_to_yum_stage('katello', 'katello', katello_version) + } + } + } + } + stage('staging-repoclosure') { + steps { + script { + def parallelStagesMap = [:] + def name = 'katello-staging' + foreman_el_releases.each { distro -> + parallelStagesMap[distro] = { repoclosure(name, distro, katello_version) } + } + parallel parallelStagesMap + } + } + post { + always { + deleteDir() + } + } + } + stage('staging-install-test') { + agent any + + steps { + script { + runDuffyPipeline('katello-rpm', katello_version) + } + } + } + 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('katello', katello_version, distro) + } + } } } } diff --git a/theforeman.org/pipelines/release/pipelines/plugins.groovy b/theforeman.org/pipelines/release/pipelines/plugins.groovy index 08713dcb..6ecbbf93 100644 --- a/theforeman.org/pipelines/release/pipelines/plugins.groovy +++ b/theforeman.org/pipelines/release/pipelines/plugins.groovy @@ -9,39 +9,107 @@ pipeline { } stages { - stage('Mash Koji Repositories') { - agent { label 'sshkey' } - - steps { - mash('foreman-plugins', foreman_version) + stage('koji') { + when { + expression { stage_source == 'koji' } } - } - stage('Repoclosure') { - agent { label 'el' } + stages { + stage('koji-mash-repositories') { + agent { label 'sshkey' } - steps { - script { - parallel repoclosures('plugins', foreman_el_releases, foreman_version) + steps { + mash('foreman-plugins', foreman_version) + } } - } - post { - always { - deleteDir() + stage('koji-repoclosure') { + agent { label 'el' } + + steps { + script { + parallel repoclosures('plugins', foreman_el_releases, foreman_version) + } + } + post { + always { + deleteDir() + } + } + } + stage('koji-push-rpms') { + agent { label 'admin && sshkey' } + + steps { + script { + def overwrite = foreman_version == 'nightly' + def merge = foreman_version != 'nightly' + for (release in foreman_el_releases) { + push_rpms_direct("foreman-plugins-${foreman_version}/${release}", "plugins/${foreman_version}/${release}", overwrite, merge) + } + } + } } } } - stage('Push RPMs') { - agent { label 'admin && sshkey' } + 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 { - def overwrite = foreman_version == 'nightly' - def merge = foreman_version != 'nightly' - for (release in foreman_el_releases) { - push_rpms_direct("foreman-plugins-${foreman_version}/${release}", "plugins/${foreman_version}/${release}", overwrite, merge) + script { + foreman_el_releases.each { distro -> + sh "./build_stage_repository plugins ${foreman_version} ${distro}" + } + } + } + } + stage('staging-copy-repository') { + steps { + script { + dir('tmp') { + rsync_to_yum_stage('plugins', 'plugins', foreman_version) + } + } + } + } + stage('staging-repoclosure') { + steps { + script { + def parallelStagesMap = [:] + def name = 'plugins-staging' + foreman_el_releases.each { distro -> + parallelStagesMap[distro] = { repoclosure(name, distro, foreman_version) } + } + parallel parallelStagesMap + } + } + post { + always { + deleteDir() + } + } + } + stage('staging-push-rpms') { + agent { label 'admin && sshkey' } + + steps { + script { + foreman_el_releases.each { distro -> + push_foreman_staging_rpms('plugins', foreman_version, distro) + } + } } } } } } + post { + failure { + notifyDiscourse(env, "Plugins ${foreman_version} pipeline failed:", currentBuild.description) + } + } }