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

Rely on theforeman-rel-eng projects to upload staging #437

Closed
wants to merge 1 commit into from
Closed
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: 11 additions & 14 deletions theforeman.org/pipelines/lib/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -481,22 +481,19 @@ def rsync_debian(user, ssh_key, suite, component, deb_paths) {
}
}

def rsync_to_yum_stage(collection, target, version) {
def user = 'yumrepostage'
def ssh_key = '/home/jenkins/workspace/staging_key/rsync_yumrepostage_key'

rsync_yum(user, ssh_key, collection, target, version)
// Scripts that wrap https://github.com/theforeman/theforeman-rel-eng
def rel_eng_clone() {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false
}

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}/"
def rel_eng_build_stage() {
script {
sh "./generate_stage_repository"
}
}

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 rel_eng_upload_stage() {
script {
sh "./upload_stage_rpms"
}
}
25 changes: 7 additions & 18 deletions theforeman.org/pipelines/release/pipelines/candlepin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,15 @@ pipeline {
when {
expression { candlepin_version == 'nightly' }
}
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

script {
candlepin_distros.each { distro ->
sh "./build_stage_repository candlepin ${candlepin_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
when {
expression { candlepin_version == 'nightly' }
environment {
PROJECT = 'candlepin'
VERSION = candlepin_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('candlepin', 'candlepin', candlepin_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
25 changes: 7 additions & 18 deletions theforeman.org/pipelines/release/pipelines/client.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,15 @@ pipeline {
when {
expression { foreman_version == 'nightly' }
}
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

script {
foreman_client_distros.each { distro ->
sh "./build_stage_repository client ${foreman_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
when {
expression { foreman_version == 'nightly' }
environment {
PROJECT = 'client'
VERSION = foreman_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('client', 'client', foreman_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
25 changes: 7 additions & 18 deletions theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,15 @@ pipeline {
when {
expression { foreman_version == 'nightly' }
}
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') {
when {
expression { foreman_version == 'nightly' }
environment {
PROJECT = 'foreman'
VERSION = foreman_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('foreman', 'foreman', foreman_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
25 changes: 7 additions & 18 deletions theforeman.org/pipelines/release/pipelines/katello.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,15 @@ pipeline {
when {
expression { katello_version == 'nightly' }
}
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} ${foreman_version}"
}
}
}
}
stage('staging-copy-repository') {
when {
expression { katello_version == 'nightly' }
environment {
PROJECT = 'katello'
VERSION = katello_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('katello', 'katello', katello_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
22 changes: 7 additions & 15 deletions theforeman.org/pipelines/release/pipelines/plugins.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,15 @@ pipeline {
agent { label 'el8' }
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 plugins ${foreman_version} ${distro}"
}
}
environment {
PROJECT = 'plugins'
VERSION = foreman_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
}
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('plugins', 'plugins', foreman_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
25 changes: 7 additions & 18 deletions theforeman.org/pipelines/release/pipelines/pulpcore.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,15 @@ pipeline {
when {
expression { pulpcore_version == 'nightly' }
}
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

script {
pulpcore_distros.each { distro ->
sh "./build_stage_repository pulpcore ${pulpcore_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
when {
expression { pulpcore_version == 'nightly' }
environment {
PROJECT = 'pulpcore'
VERSION = pulpcore_version
RSYNC_RSH = "ssh -i ${ssh_key}"
}
steps {
script {
dir('tmp') {
rsync_to_yum_stage('pulpcore', 'pulpcore', pulpcore_version)
}
}
rel_eng_clone()
rel_eng_build_stage()
rel_eng_upload_stage()
}
}
stage('staging-repoclosure') {
Expand Down
Loading