From 2ac6c23ed7800a4ed6a0d4b436782153dfdd015e Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Wed, 1 Nov 2023 11:43:00 -0400 Subject: [PATCH] Use upload_stage_rpms to rsync to stagingyum --- theforeman.org/pipelines/lib/packaging.groovy | 25 ++++++++----------- .../release/pipelines/candlepin.groovy | 4 +-- .../pipelines/release/pipelines/client.groovy | 4 +-- .../release/pipelines/foreman-rpm.groovy | 4 +-- .../release/pipelines/katello.groovy | 4 +-- .../release/pipelines/plugins.groovy | 4 +-- .../release/pipelines/pulpcore.groovy | 4 +-- 7 files changed, 16 insertions(+), 33 deletions(-) diff --git a/theforeman.org/pipelines/lib/packaging.groovy b/theforeman.org/pipelines/lib/packaging.groovy index 0ba59ee2..263811f5 100644 --- a/theforeman.org/pipelines/lib/packaging.groovy +++ b/theforeman.org/pipelines/lib/packaging.groovy @@ -472,22 +472,17 @@ def rsync_debian(user, ssh_key, suite, component, deb_paths) { } } -def rsync_to_yum_stage(collection, target, version) { - def user = 'yumrepostage' +def rsync_to_yum_stage(collection, version) { def ssh_key = '/home/jenkins/workspace/staging_key/rsync_yumrepostage_key' - rsync_yum(user, ssh_key, collection, target, version) -} - -def rsync_yum(user, ssh_key, collection, target, version) { - def hosts = ["web01.osuosl.theforeman.org"] - - for(host in hosts) { - def target_path = "${user}@${host}:rsync_cache/${target}/${version}/" - - sh """ - export RSYNC_RSH="ssh -i ${ssh_key}" - /usr/bin/rsync --checksum --times --perms --recursive --links --verbose --partial --one-file-system --delete-after ${collection}/${version}/ ${target_path} - """ + if (!fileExists('upload_stage_rpms')) { + git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false } + + sh """ + export RSYNC_RSH="ssh -i ${ssh_key}" + export VERSION=${version} + export PROJECT=${collection} + ./upload_stage_rpms + """ } diff --git a/theforeman.org/pipelines/release/pipelines/candlepin.groovy b/theforeman.org/pipelines/release/pipelines/candlepin.groovy index 91a6c118..8674b5b4 100644 --- a/theforeman.org/pipelines/release/pipelines/candlepin.groovy +++ b/theforeman.org/pipelines/release/pipelines/candlepin.groovy @@ -29,9 +29,7 @@ pipeline { } steps { script { - dir('tmp') { - rsync_to_yum_stage('candlepin', 'candlepin', candlepin_version) - } + rsync_to_yum_stage('candlepin', candlepin_version) } } } diff --git a/theforeman.org/pipelines/release/pipelines/client.groovy b/theforeman.org/pipelines/release/pipelines/client.groovy index 7bf065a9..e0a2e0a6 100644 --- a/theforeman.org/pipelines/release/pipelines/client.groovy +++ b/theforeman.org/pipelines/release/pipelines/client.groovy @@ -83,9 +83,7 @@ pipeline { } steps { script { - dir('tmp') { - rsync_to_yum_stage('client', 'client', foreman_version) - } + rsync_to_yum_stage('client', foreman_version) } } } diff --git a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy index efab3a60..d1a3c5cd 100644 --- a/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy +++ b/theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy @@ -82,9 +82,7 @@ pipeline { } steps { script { - dir('tmp') { - rsync_to_yum_stage('foreman', 'foreman', foreman_version) - } + rsync_to_yum_stage('foreman', foreman_version) } } } diff --git a/theforeman.org/pipelines/release/pipelines/katello.groovy b/theforeman.org/pipelines/release/pipelines/katello.groovy index 0b6ce1a9..9f74350d 100644 --- a/theforeman.org/pipelines/release/pipelines/katello.groovy +++ b/theforeman.org/pipelines/release/pipelines/katello.groovy @@ -83,9 +83,7 @@ pipeline { } steps { script { - dir('tmp') { - rsync_to_yum_stage('katello', 'katello', katello_version) - } + rsync_to_yum_stage('katello', katello_version) } } } diff --git a/theforeman.org/pipelines/release/pipelines/plugins.groovy b/theforeman.org/pipelines/release/pipelines/plugins.groovy index 6ecbbf93..d2dbb3b5 100644 --- a/theforeman.org/pipelines/release/pipelines/plugins.groovy +++ b/theforeman.org/pipelines/release/pipelines/plugins.groovy @@ -70,9 +70,7 @@ pipeline { stage('staging-copy-repository') { steps { script { - dir('tmp') { - rsync_to_yum_stage('plugins', 'plugins', foreman_version) - } + rsync_to_yum_stage('plugins', foreman_version) } } } diff --git a/theforeman.org/pipelines/release/pipelines/pulpcore.groovy b/theforeman.org/pipelines/release/pipelines/pulpcore.groovy index fc1ccdd6..d7745769 100644 --- a/theforeman.org/pipelines/release/pipelines/pulpcore.groovy +++ b/theforeman.org/pipelines/release/pipelines/pulpcore.groovy @@ -94,9 +94,7 @@ pipeline { } steps { script { - dir('tmp') { - rsync_to_yum_stage('pulpcore', 'pulpcore', pulpcore_version) - } + rsync_to_yum_stage('pulpcore', pulpcore_version) } } }