Skip to content

Commit

Permalink
Add Copr nightly test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Oct 29, 2023
1 parent d1c4492 commit 855d4a2
Show file tree
Hide file tree
Showing 4 changed files with 238 additions and 64 deletions.
141 changes: 109 additions & 32 deletions theforeman.org/pipelines/release/pipelines/foreman-rpm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,128 @@ pipeline {
}

stages {
stage('Mash Koji Repositories') {
agent { label 'sshkey' }

steps {
mash('foreman', 'nightly')
stage('koji') {
when {
expression { stage_source == 'koji' }
}
}
stage('Repoclosure') {
agent { label 'el' }
stages {
stage('koji-mash-repositories') {
agent { label 'sshkey' }

steps {
mash('foreman', 'nightly')
}
}
stage('koji-repoclosure') {
agent { label 'el' }

steps {
script {
parallel repoclosures('foreman', foreman_el_releases, foreman_version)
}
}
post {
always {
deleteDir()
}
}
}
stage('koji-install-test') {
agent any

steps {
script {
parallel repoclosures('foreman', foreman_el_releases, foreman_version)
steps {
script {
runDuffyPipeline('foreman-rpm', foreman_version)
}
}
}
stage('koji-push-rpms') {
agent { label 'admin && sshkey' }
steps {
script {
for (release in foreman_el_releases) {
push_rpms_direct("foreman-${foreman_version}/${release}", "${foreman_version}/${release}")
}
}
}
}
}
post {
always {
deleteDir()
failure {
notifyDiscourse(env, 'Foreman RPM nightly pipeline failed:', currentBuild.description)
}
}
}
stage('Install Test') {
agent any
stage('staging') {
agent { label 'el8' }
when {
expression { stage_source == 'stagingyum' }
}
stages {
stage('staging-build-repository') {
steps {
git url: "https://github.com/theforeman/theforeman-rel-eng", poll: false

steps {
script {
runDuffyPipeline('foreman-rpm', foreman_version)
script {
foreman_el_releases.each { distro ->
sh "./build_stage_repository foreman ${foreman_version} ${distro}"
}
}
}
}
}
}
stage('Push RPMs') {
agent { label 'admin && sshkey' }
steps {
script {
for (release in foreman_el_releases) {
push_rpms_direct("foreman-${foreman_version}/${release}", "${foreman_version}/${release}")
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('foreman', 'foreman', foreman_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
def parallelStagesMap = [:]
def name = 'foreman-staging'
foreman_el_releases.each { distro ->
parallelStagesMap[distro] = { repoclosure(name, distro, foreman_version) }
}
parallel parallelStagesMap
}
}
post {
always {
deleteDir()
}
}
}
stage('staging-install-test') {
agent any

steps {
script {
runDuffyPipeline('foreman-rpm', foreman_version)
}
}
}
stage('staging-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
//push_foreman_staging_rpms('foreman', foreman_version, distro)
echo "PUSH TO PROD"
}
}
}
}
}
}
}
post {
failure {
notifyDiscourse(env, 'Foreman RPM nightly pipeline failed:', currentBuild.description)
post {
failure {
echo "staging yum failed"
}
}
}
}
}

140 changes: 109 additions & 31 deletions theforeman.org/pipelines/release/pipelines/katello.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,129 @@ pipeline {
}

stages {
stage('Mash Koji Repositories') {
agent { label 'sshkey' }

steps {
mash("katello", katello_version)
stage('koji') {
when {
expression { stage_source == 'koji' }
}
}
stage('Katello Repoclosure') {
agent { label 'el' }
stages {
stage('koji-mash-repositories') {
agent { label 'sshkey' }

steps {
mash("katello", katello_version)
}
}
stage('koji-repoclosure') {
agent { label 'el' }

steps {
script {
parallel repoclosures('katello', foreman_el_releases, foreman_version)
steps {
script {
parallel repoclosures('katello', foreman_el_releases, foreman_version)
}
}
post {
always {
deleteDir()
}
}
}
stage('koji-install-test') {
agent any

steps {
script {
runDuffyPipeline('katello-rpm', katello_version)
}
}
}
stage('koji-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
push_katello_rpms(katello_version, distro)
}
}
}
}
}
post {
always {
deleteDir()
failure {
notifyDiscourse(env, "Katello ${katello_version} pipeline failed:", currentBuild.description)
}
}
}
stage('Test Suites') {
agent any
stage('staging') {
agent { label 'el8' }
when {
expression { stage_source == 'stagingyum' }
}
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 katello ${foreman_version} ${distro}"
}
}
}
}
stage('staging-copy-repository') {
steps {
script {
dir('tmp') {
rsync_to_yum_stage('katello', 'katello', foreman_version)
}
}
}
}
stage('staging-repoclosure') {
steps {
script {
def parallelStagesMap = [:]
def name = 'katello-staging'
foreman_el_releases.each { distro ->
parallelStagesMap[distro] = { repoclosure(name, distro, foreman_version) }
}
parallel parallelStagesMap
}
}
post {
always {
deleteDir()
}
}
}
stage('staging-install-test') {
agent any

steps {
script {
runDuffyPipeline('katello-rpm', katello_version)
steps {
script {
runDuffyPipeline('katello-rpm', katello_version)
}
}
}
}
}
stage('Push RPMs') {
agent { label 'admin && sshkey' }
stage('staging-push-rpms') {
agent { label 'admin && sshkey' }

steps {
script {
foreman_el_releases.each { distro ->
push_katello_rpms(katello_version, distro)
steps {
script {
foreman_el_releases.each { distro ->
//push_foreman_staging_rpms('katello', foreman_version, distro)
echo "PUSH TO PROD"
}
}
}
}
}
}
}
post {
failure {
notifyDiscourse(env, "Katello ${katello_version} pipeline failed:", currentBuild.description)
post {
failure {
echo "staging yum failed"
}
}
}
}
}
2 changes: 1 addition & 1 deletion theforeman.org/pipelines/vars/foreman/nightly.groovy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
def foreman_version = 'nightly'
def git_branch = "develop"
def stage_source = 'koji'
def stage_source = 'stagingyum'

def foreman_client_distros = [
'el9',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,22 @@
- pipelines/lib/foreman_infra.groovy
- pipelines/lib/packaging.groovy
- pipelines/lib/obal.groovy

- job:
name: katello-nightly-rpm-copr-pipeline
project-type: pipeline
sandbox: true
triggers:
- reverse:
jobs:
- foreman-nightly-rpm-copr-pipeline
result: success
dsl:
!include-raw:
- pipelines/vars/katello/nightly.groovy
- pipelines/release/pipelines/katello-copr.groovy
- pipelines/lib/release.groovy
- pipelines/lib/ansible.groovy
- pipelines/lib/foreman_infra.groovy
- pipelines/lib/packaging.groovy
- pipelines/lib/obal.groovy

0 comments on commit 855d4a2

Please sign in to comment.