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

Align the develop and stable testing jobs #529

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ pipeline {
buildDiscarder(logRotator(daysToKeepStr: '7'))
}

triggers {
upstream(upstreamProjects: source_project_name, threshold: hudson.model.Result.SUCCESS)
}

stages {
stage('Build Package') {
parallel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ pipeline {
}
}
post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)
}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ pipeline {
}
}
post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)
}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}
Expand Down
9 changes: 0 additions & 9 deletions theforeman.org/pipelines/release/source/foreman.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,6 @@ pipeline {
}

post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)

}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}
Expand Down
8 changes: 0 additions & 8 deletions theforeman.org/pipelines/release/source/hammer-cli-x.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ pipeline {
}
}
post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)
}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}
Expand Down
8 changes: 0 additions & 8 deletions theforeman.org/pipelines/release/source/katello.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ pipeline {
}

post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)
}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}
Expand Down
54 changes: 25 additions & 29 deletions theforeman.org/pipelines/release/source/smart-proxy.groovy
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pipeline {
agent any
agent none

options {
timestamps()
timeout(time: 2, unit: 'HOURS')
timeout(time: 1, unit: 'HOURS')
ansiColor('xterm')
buildDiscarder(logRotator(daysToKeepStr: '7'))
}
Expand All @@ -18,13 +18,22 @@ pipeline {
values '2.7.6', '3.0.4', '3.1.0'
}
}
environment {
BUNDLE_WITHOUT = 'development'
}
stages {
stage("Clone repository") {
steps {
git url: git_url, branch: git_ref
}
}
stage("Test Ruby") {
stage('Install dependencies') {
steps {
bundleInstall(ruby)
archiveArtifacts(artifacts: 'Gemfile.lock')
}
}
stage('Run tests') {
environment {
// ci_reporters gem
CI_REPORTS = 'jenkins/reports/unit'
Expand All @@ -33,13 +42,20 @@ pipeline {
MINITEST_REPORTERS_REPORTS_DIR = 'jenkins/reports/unit'
}
steps {
run_test(ruby: env.ruby)
bundleExec(ruby, 'rake jenkins:unit')
}
post {
always {
junit testResults: 'jenkins/reports/unit/*.xml'
}
}
}
}
}
}
stage('Build and Archive Source') {
agent any

steps {
dir(project_name) {
git url: git_url, branch: git_ref
Expand All @@ -53,37 +69,17 @@ pipeline {
sourcefile_paths = generate_sourcefiles(project_name: project_name, source_type: source_type)
}
}
post {
always {
deleteDir()
}
}
}
}

post {
success {
build(
job: "${project_name}-${git_ref}-package-release",
propagate: false,
wait: false
)
}

failure {
notifyDiscourse(env, "${project_name} source release pipeline failed:", currentBuild.description)
}

cleanup {
deleteDir()
}
}
}

def run_test(args) {
def ruby = args.ruby

try {
sh "cp config/settings.yml.example config/settings.yml"
bundleInstall(ruby, "--without=development")
archiveArtifacts(artifacts: 'Gemfile.lock')
bundleExec(ruby, "rake jenkins:unit --trace")
} finally {
junit(testResults: 'jenkins/reports/unit/*.xml')
}
}
15 changes: 5 additions & 10 deletions theforeman.org/pipelines/test/smart-proxy.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
pipeline {
agent none

options {
timeout(time: 1, unit: 'HOURS')
ansiColor('xterm')
}
environment {
BUNDLE_JOBS = 4
BUNDLE_RETRY = 3
}

stages {
stage('Rubocop') {
Expand Down Expand Up @@ -59,19 +56,18 @@ pipeline {
BUNDLE_WITHOUT = 'development'
}
stages {
stage('Setup Git Repos') {
stage("Clone repository") {
steps {
script {
git_checkout()
}
git branch: git_branch, url: 'https://github.com/theforeman/smart-proxy'
}
}
stage('Install dependencies') {
steps {
bundleInstall(ruby)
archiveArtifacts(artifacts: 'Gemfile.lock')
}
}
stage('Run Tests') {
stage('Run tests') {
environment {
// ci_reporters gem
CI_REPORTS = 'jenkins/reports/unit'
Expand All @@ -91,7 +87,6 @@ pipeline {
}
post {
always {
archiveArtifacts artifacts: 'Gemfile.lock'
deleteDir()
}
}
Expand Down
Loading