Skip to content

Commit

Permalink
Use upload_stage_rpms to rsync to stagingyum
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Jan 22, 2024
1 parent 2fb6c3b commit 8ca854b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 26 deletions.
27 changes: 13 additions & 14 deletions theforeman.org/pipelines/lib/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -472,22 +472,21 @@ 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"]
if (!fileExists('upload_stage_rpms')) {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false
}

for(host in hosts) {
def target_path = "${user}@${host}:rsync_cache/${target}/${version}/"
sh """
export RSYNC_RSH="ssh -i ${ssh_key}"
export VERSION=${version}
export PROJECT=${collection}
./upload_stage_rpms
"""
}

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}
"""
}
def clone_theforeman_rel_eng() {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pipeline {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('candlepin', 'candlepin', candlepin_version)
rsync_to_yum_stage('candlepin', candlepin_version)
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions theforeman.org/pipelines/release/pipelines/client.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ pipeline {
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('client', 'client', foreman_version)
}
rsync_to_yum_stage('client', foreman_version)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ pipeline {
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('foreman', 'foreman', foreman_version)
}
rsync_to_yum_stage('foreman', foreman_version)
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions theforeman.org/pipelines/release/pipelines/katello.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ pipeline {
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('katello', 'katello', katello_version)
}
rsync_to_yum_stage('katello', katello_version)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion theforeman.org/pipelines/release/pipelines/plugins.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pipeline {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('plugins', 'plugins', foreman_version)
rsync_to_yum_stage('plugins', foreman_version)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion theforeman.org/pipelines/release/pipelines/pulpcore.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pipeline {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('pulpcore', 'pulpcore', pulpcore_version)
rsync_to_yum_stage('pulpcore', pulpcore_version)
}
}
}
Expand Down

0 comments on commit 8ca854b

Please sign in to comment.