diff --git a/theforeman.org/pipelines/lib/packaging.groovy b/theforeman.org/pipelines/lib/packaging.groovy index 3ea691e0..3f15d746 100644 --- a/theforeman.org/pipelines/lib/packaging.groovy +++ b/theforeman.org/pipelines/lib/packaging.groovy @@ -481,17 +481,12 @@ def rsync_debian(user, ssh_key, suite, component, deb_paths) { } } -def rsync_to_yum_stage(collection, version) { - def ssh_key = '/home/jenkins/workspace/staging_key/rsync_yumrepostage_key' +def rsync_to_yum_stage() { + git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false - if (!fileExists('upload_stage_rpms')) { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false - } + sh "./generate_stage_repository" - sh """ - export RSYNC_RSH="ssh -i ${ssh_key}" - export VERSION=${version} - export PROJECT=${collection} - ./upload_stage_rpms - """ + sshagent(['yum-stage']) { + sh "./upload_stage_rpms" + } } diff --git a/theforeman.org/pipelines/release/pipelines/candlepin.groovy b/theforeman.org/pipelines/release/pipelines/candlepin.groovy index 730a1b58..fdbc280b 100644 --- a/theforeman.org/pipelines/release/pipelines/candlepin.groovy +++ b/theforeman.org/pipelines/release/pipelines/candlepin.groovy @@ -8,35 +8,29 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - when { - expression { candlepin_version == 'nightly' } - } - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'candlepin' + } - script { - candlepin_distros.each { distro -> - sh "./build_stage_repository candlepin ${candlepin_version} ${distro}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = candlepin_version + } + + stages { + stage('staging-repository') { when { - expression { candlepin_version == 'nightly' } + expression { env.VERSION == 'nightly' } } steps { script { - rsync_to_yum_stage('candlepin', candlepin_version) + rsync_to_yum_stage } } } stage('staging-repoclosure') { steps { script { - parallel repoclosures('candlepin', candlepin_distros, candlepin_version) + parallel repoclosures(env.PROJECT, candlepin_distros, env.VERSION) } } post { @@ -50,7 +44,7 @@ pipeline { steps { script { - runDuffyPipeline('candlepin-rpm', candlepin_version) + runDuffyPipeline("${env.PROJECT}-rpm", env.VERSION) } } } @@ -60,7 +54,7 @@ pipeline { steps { script { candlepin_distros.each { distro -> - push_foreman_staging_rpms('candlepin', candlepin_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } @@ -68,7 +62,7 @@ pipeline { } post { failure { - notifyDiscourse(env, "Candlepin ${candlepin_version} RPM pipeline failed:", currentBuild.description) + notifyDiscourse(env, "${env.PROJECT} ${env.VERSION} RPM pipeline failed:", currentBuild.description) } } } diff --git a/theforeman.org/pipelines/release/pipelines/client.groovy b/theforeman.org/pipelines/release/pipelines/client.groovy index 5d5d9e3d..4b3a83a6 100644 --- a/theforeman.org/pipelines/release/pipelines/client.groovy +++ b/theforeman.org/pipelines/release/pipelines/client.groovy @@ -8,35 +8,29 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - when { - expression { foreman_version == 'nightly' } - } - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'client' + } - script { - foreman_client_distros.each { distro -> - sh "./build_stage_repository client ${foreman_version} ${distro}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = foreman_version + } + + stages { + stage('staging-repository') { when { - expression { foreman_version == 'nightly' } + expression { env.VERSION == 'nightly' } } steps { script { - rsync_to_yum_stage('client', foreman_version) + rsync_to_yum_stage } } } stage('staging-repoclosure') { steps { script { - parallel repoclosures('foreman-client-staging', foreman_client_distros, foreman_version) + parallel repoclosures("foreman-${env.PROJECT}-staging", foreman_client_distros, env.VERSION) } } post { @@ -51,7 +45,7 @@ pipeline { steps { script { foreman_client_distros.each { distro -> - push_foreman_staging_rpms('client', foreman_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } diff --git a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy index aa87cc38..588d5980 100644 --- a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy +++ b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy @@ -8,35 +8,29 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - when { - expression { foreman_version == 'nightly' } - } - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'foreman' + } - script { - foreman_el_releases.each { distro -> - sh "./build_stage_repository foreman ${foreman_version} ${distro}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = foreman_version + } + + stages { + stage('staging-repository') { when { - expression { foreman_version == 'nightly' } + expression { env.VERSION == 'nightly' } } steps { script { - rsync_to_yum_stage('foreman', foreman_version) + rsync_to_yum_stage } } } stage('staging-repoclosure') { steps { script { - parallel repoclosures('foreman-staging', foreman_el_releases, foreman_version) + parallel repoclosures("${env.PROJECT}-staging", foreman_el_releases, env.VERSION) } } post { @@ -50,7 +44,7 @@ pipeline { steps { script { - runDuffyPipeline('foreman-rpm', foreman_version) + runDuffyPipeline("${env.PROJECT}-rpm", env.VERSION) } } } @@ -60,7 +54,7 @@ pipeline { steps { script { foreman_el_releases.each { distro -> - push_foreman_staging_rpms('foreman', foreman_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } @@ -68,7 +62,7 @@ pipeline { } post { failure { - notifyDiscourse(env, 'Foreman RPM nightly pipeline failed:', currentBuild.description) + notifyDiscourse(env, "${env.PROJECT} ${env.VERSION} RPM pipeline failed:", currentBuild.description) } } } diff --git a/theforeman.org/pipelines/release/pipelines/katello.groovy b/theforeman.org/pipelines/release/pipelines/katello.groovy index 597b155e..a6d3004e 100644 --- a/theforeman.org/pipelines/release/pipelines/katello.groovy +++ b/theforeman.org/pipelines/release/pipelines/katello.groovy @@ -8,28 +8,22 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - when { - expression { katello_version == 'nightly' } - } - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'katello' + } - script { - foreman_el_releases.each { distro -> - sh "./build_stage_repository katello ${katello_version} ${distro} ${foreman_version}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = katello_version + } + + stages { + stage('staging-repository') { when { - expression { katello_version == 'nightly' } + expression { env.VERSION == 'nightly' } } steps { script { - rsync_to_yum_stage('katello', katello_version) + rsync_to_yum_stage } } } @@ -50,7 +44,7 @@ pipeline { steps { script { - runDuffyPipeline('katello-rpm', katello_version) + runDuffyPipeline("${env.PROJECT}-rpm", env.VERSION) } } } @@ -60,7 +54,7 @@ pipeline { steps { script { foreman_el_releases.each { distro -> - push_foreman_staging_rpms('katello', katello_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } @@ -68,7 +62,7 @@ pipeline { } post { failure { - notifyDiscourse(env, "Katello ${katello_version} pipeline failed:", currentBuild.description) + notifyDiscourse(env, "${env.PROJECT} ${env.VERSION} RPM pipeline failed:", currentBuild.description) } } } diff --git a/theforeman.org/pipelines/release/pipelines/plugins.groovy b/theforeman.org/pipelines/release/pipelines/plugins.groovy index eec3099a..3c3359bf 100644 --- a/theforeman.org/pipelines/release/pipelines/plugins.groovy +++ b/theforeman.org/pipelines/release/pipelines/plugins.groovy @@ -8,29 +8,26 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'plugins' + } - script { - foreman_el_releases.each { distro -> - sh "./build_stage_repository plugins ${foreman_version} ${distro}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = foreman_version + } + + stages { + stage('staging-repository') { steps { script { - rsync_to_yum_stage('plugins', foreman_version) + rsync_to_yum_stage } } } stage('staging-repoclosure') { steps { script { - parallel repoclosures('plugins-staging', foreman_el_releases, foreman_version) + parallel repoclosures("${env.PROJECT}-staging", foreman_el_releases, env.VERSION) } } post { @@ -45,7 +42,7 @@ pipeline { steps { script { foreman_el_releases.each { distro -> - push_foreman_staging_rpms('plugins', foreman_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } @@ -53,7 +50,7 @@ pipeline { } post { failure { - notifyDiscourse(env, "Plugins ${foreman_version} pipeline failed:", currentBuild.description) + notifyDiscourse(env, "${env.PROJECT} ${env.VERSION} RPM pipeline failed:", currentBuild.description) } } } diff --git a/theforeman.org/pipelines/release/pipelines/pulpcore.groovy b/theforeman.org/pipelines/release/pipelines/pulpcore.groovy index 0112c58e..f787e864 100644 --- a/theforeman.org/pipelines/release/pipelines/pulpcore.groovy +++ b/theforeman.org/pipelines/release/pipelines/pulpcore.groovy @@ -8,35 +8,29 @@ pipeline { ansiColor('xterm') } - stages { - stage('staging-build-repository') { - when { - expression { pulpcore_version == 'nightly' } - } - steps { - git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false + environment { + PROJECT = 'pulpcore' + } - script { - pulpcore_distros.each { distro -> - sh "./build_stage_repository pulpcore ${pulpcore_version} ${distro}" - } - } - } - } - stage('staging-copy-repository') { + script { + env.VERSION = pulpcore_version + } + + stages { + stage('staging-repository') { when { - expression { pulpcore_version == 'nightly' } + expression { env.VERSION == 'nightly' } } steps { script { - rsync_to_yum_stage('pulpcore', pulpcore_version) + rsync_to_yum_stage } } } stage('staging-repoclosure') { steps { script { - parallel repoclosures('pulpcore-staging', foreman_el_releases, foreman_version) + parallel repoclosures("${env.PROJECT}-staging", pulpcore_distros, env.VERSION) } } post { @@ -50,7 +44,7 @@ pipeline { steps { script { - runDuffyPipeline('pulpcore-rpm', pulpcore_version) + runDuffyPipeline("${env.PROJECT}-rpm", env.VERSION) } } } @@ -60,7 +54,7 @@ pipeline { steps { script { pulpcore_distros.each { distro -> - push_foreman_staging_rpms('pulpcore', pulpcore_version, distro) + push_foreman_staging_rpms(env.PROJECT, env.VERSION, distro) } } } @@ -68,7 +62,7 @@ pipeline { } post { failure { - notifyDiscourse(env, "Pulpcore ${pulpcore_version} RPM pipeline failed:", currentBuild.description) + notifyDiscourse(env, "${env.PROJECT} ${env.VERSION} RPM pipeline failed:", currentBuild.description) } } }