Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use upload_stage_rpms to rsync to stagingyum #369

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 10 additions & 15 deletions theforeman.org/pipelines/lib/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Comment on lines +478 to 480
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, this is contrary to what Ewoud asked for, but the previous step is always build_stage_repository which comes from the same repo. So I'd argue it's either guaranteed that the repo is already checked out (one could also argue to have a prep step that does only that, for clarity), or whatever is on disk should absolutely not be synced.


sh """
export RSYNC_RSH="ssh -i ${ssh_key}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is ssh_key defined?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 476

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bleh, reading diffs is hard.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Blame Richmond.

export VERSION=${version}
export PROJECT=${collection}
./upload_stage_rpms
"""
}
4 changes: 1 addition & 3 deletions theforeman.org/pipelines/release/pipelines/candlepin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,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
4 changes: 1 addition & 3 deletions theforeman.org/pipelines/release/pipelines/plugins.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions theforeman.org/pipelines/release/pipelines/pulpcore.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,7 @@ pipeline {
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('pulpcore', 'pulpcore', pulpcore_version)
}
rsync_to_yum_stage('pulpcore', pulpcore_version)
}
}
}
Expand Down