diff --git a/branch-foreman b/branch-foreman index 9aaf2c55..9e64435a 100755 --- a/branch-foreman +++ b/branch-foreman @@ -30,28 +30,3 @@ echo "Create theforeman.org/yaml/jobs/test_${FOREMAN_VERSION/./_}_stable.yaml" # TODO This is a non-trivial addition to script echo "Add ${FOREMAN_VERSION%*.} as a minor to theforeman.org/yaml/views/release.yml" - -# TODO The sed line was too complex -echo "Add the following to the foreman_integration_versions section in theforeman.org/pipelines/test/foreman/vars.groovy" -cat </dev/null 2>/dev/null || true'], ruby) - withRVM(['bundle exec rake db:create RAILS_ENV=test'], ruby) - withRVM(['bundle exec rake db:migrate RAILS_ENV=test'], ruby) - withRVM(['bundle exec rake db:seed RAILS_ENV=test'], ruby) - - } - - } - } - } - post { - always { - dir('foreman') { - archiveArtifacts artifacts: "log/test.log" - junit keepLongStdio: true, testResults: 'jenkins/reports/unit/*.xml' - } - } - cleanup { - dir('foreman') { - cleanup(ruby) - } - deleteDir() - } - } - } - } - } - -} diff --git a/theforeman.org/pipelines/test/foreman/unit.groovy b/theforeman.org/pipelines/test/foreman/unit.groovy deleted file mode 100644 index ed7e2644..00000000 --- a/theforeman.org/pipelines/test/foreman/unit.groovy +++ /dev/null @@ -1,63 +0,0 @@ -//def ruby_versions = foreman_unit_versions[ghprbTargetBranch]['ruby'] -def ruby_versions = foreman_unit_versions['develop']['ruby'] - -pipeline { - agent none - - options { - timestamps() - timeout(time: 2, unit: 'HOURS') - ansiColor('xterm') - } - - stages { - stage('matrix') { - matrix { - agent { label 'fast' } - axes { - axis { - name 'ruby' - values '2.7' - } - } - when { - expression { - ruby_versions.contains(ruby) - } - } - stages { - stage('repository') { - steps { - ghprb_git_checkout() - } - } - stage('rvm') { - steps { - configureRVM(ruby) - } - } - stage('database') { - steps { - databaseFile(gemset()) - configureDatabase(ruby) - } - } - stage("unit-tests") { - steps { - withRVM(['bundle exec rake jenkins:unit TESTOPTS="-v" --trace'], ruby) - } - } - } - post { - always { - junit(testResults: 'jenkins/reports/unit/*.xml') - } - cleanup { - cleanup(ruby) - deleteDir() - } - } - } - } - } -} diff --git a/theforeman.org/pipelines/test/foreman/vars.groovy b/theforeman.org/pipelines/test/foreman/vars.groovy deleted file mode 100644 index 2fbd75d4..00000000 --- a/theforeman.org/pipelines/test/foreman/vars.groovy +++ /dev/null @@ -1,28 +0,0 @@ -def foreman_integration_versions = [ - 'develop': [ - 'ruby': ['2.7'], - 'katello': 'master' - ], - '3.10-stable': [ - 'ruby': ['2.7'], - 'katello': 'KATELLO-4.12' - ], - '3.9-stable': [ - 'ruby': ['2.7'], - 'katello': 'KATELLO-4.11' - ], -] - -def foreman_unit_versions = [ - 'develop': [ - 'ruby': ['2.7'] - ], - '3.10-stable': [ - 'ruby': ['2.7'], - 'katello': 'KATELLO-4.12' - ], - '3.9-stable': [ - 'ruby': ['2.7'], - 'katello': 'KATELLO-4.11' - ], -] diff --git a/theforeman.org/pipelines/test/testKatello.groovy b/theforeman.org/pipelines/test/testKatello.groovy deleted file mode 100644 index 5fee2083..00000000 --- a/theforeman.org/pipelines/test/testKatello.groovy +++ /dev/null @@ -1,152 +0,0 @@ -def katello_versions = [ - 'master': [ - 'foreman': 'develop', - 'ruby': ['2.7'] - ], - 'KATELLO-4.12': [ - 'foreman': '3.10-stable', - 'ruby': ['2.7'] - ], - 'KATELLO-4.11': [ - 'foreman': '3.9-stable', - 'ruby': ['2.7'] - ], -] - -def ruby_versions = katello_versions[ghprbTargetBranch]['ruby'] -def foreman_branch = katello_versions[ghprbTargetBranch]['foreman'] - -pipeline { - agent none - - options { - timestamps() - timeout(time: 3, unit: 'HOURS') - ansiColor('xterm') - } - - stages { - stage('Test') { - matrix { - agent { label 'fast' } - axes { - axis { - name 'ruby' - values '2.7' - } - } - when { - expression { - ruby_versions.contains(env.ruby) - } - } - stages { - stage('Setup Git Repos') { - steps { - ghprb_git_checkout() - - dir('foreman') { - git url: "https://github.com/theforeman/foreman", branch: foreman_branch, poll: false - } - } - } - stage("Setup RVM") { - steps { - - configureRVM(ruby) - - } - } - stage('Configure Environment') { - steps { - - dir('foreman') { - addGem() - databaseFile(gemset()) - } - - } - } - stage('Configure Database') { - steps { - - dir('foreman') { - configureDatabase(ruby) - } - - } - } - stage('rubocop') { - steps { - dir('foreman') { - withRVM(['bundle exec rake katello:rubocop TESTOPTS="-v" --trace'], ruby) - } - } - } - stage('tests') { - steps { - dir('foreman') { - withRVM(['bundle exec rake jenkins:katello TESTOPTS="-v" --trace'], ruby) - } - } - } - stage('assets-precompile') { - steps { - dir('foreman') { - filter_package_json(ruby) - - sh(script: "cp db/schema.rb.nulldb db/schema.rb", label: "copy nulldb schema") - withRVM(["bundle exec npm install --package-lock-only --no-audit"], ruby) - withRVM(["bundle exec npm ci --no-audit"], ruby) - withRVM(['bundle exec rake plugin:assets:precompile[katello] RAILS_ENV=production DATABASE_URL=nulldb://nohost --trace'], ruby) - } - } - } - stage('Test db:seed') { - steps { - - dir('foreman') { - - withRVM(['bundle exec rake db:drop RAILS_ENV=test >/dev/null 2>/dev/null || true'], ruby) - withRVM(['bundle exec rake db:create RAILS_ENV=test'], ruby) - withRVM(['bundle exec rake db:migrate RAILS_ENV=test'], ruby) - withRVM(['bundle exec rake db:seed RAILS_ENV=test'], ruby) - - } - - } - } - stage('angular-ui') { - steps { - dir('engines/bastion') { - sh(script: "npm install --package-lock-only --no-audit", label: "npm install --package-lock-only") - sh(script: "npm ci --no-audit", label: "npm ci") - sh(script: "grunt ci", label: "grunt ci") - } - dir('engines/bastion_katello') { - sh(script: "npm install --package-lock-only --no-audit", label: "npm install --package-lock-only") - sh(script: "npm ci --no-audit", label: "npm ci") - sh(script: "grunt ci", label: "grunt ci") - } - } - } - } - post { - always { - dir('foreman') { - archiveArtifacts artifacts: "log/test.log" - junit keepLongStdio: true, testResults: 'jenkins/reports/unit/*.xml' - } - } - cleanup { - dir('foreman') { - cleanup(ruby) - } - deleteDir() - } - } - } - } - } - -} diff --git a/theforeman.org/yaml/jobs/tests/foreman-pr-test.yaml b/theforeman.org/yaml/jobs/tests/foreman-pr-test.yaml deleted file mode 100644 index deb2fc05..00000000 --- a/theforeman.org/yaml/jobs/tests/foreman-pr-test.yaml +++ /dev/null @@ -1,59 +0,0 @@ -- job: - name: foreman-pr-unit-test - project-type: pipeline - sandbox: true - concurrent: true - properties: - - github: - url: https://github.com/theforeman/foreman - - tfm-pull-request-build-discarder - triggers: - - github_pr_pipeline: - context: 'unit' - dsl: - !include-raw: - - pipelines/test/foreman/vars.groovy - - pipelines/test/foreman/unit.groovy - - pipelines/lib/rvm.groovy - - pipelines/lib/git.groovy - - pipelines/lib/foreman.groovy - -- job: - name: foreman-pr-integration-test - project-type: pipeline - sandbox: true - concurrent: true - properties: - - github: - url: https://github.com/theforeman/foreman - - tfm-pull-request-build-discarder - triggers: - - github_pr_pipeline: - context: 'integration' - dsl: - !include-raw: - - pipelines/test/foreman/vars.groovy - - pipelines/test/foreman/integration.groovy - - pipelines/lib/rvm.groovy - - pipelines/lib/git.groovy - - pipelines/lib/foreman.groovy - -- job: - name: foreman-pr-katello-test - project-type: pipeline - sandbox: true - concurrent: true - properties: - - github: - url: https://github.com/theforeman/foreman - - tfm-pull-request-build-discarder - triggers: - - github_pr_pipeline: - context: 'katello' - dsl: - !include-raw: - - pipelines/test/foreman/vars.groovy - - pipelines/test/foreman/katello.groovy - - pipelines/lib/rvm.groovy - - pipelines/lib/git.groovy - - pipelines/lib/foreman.groovy diff --git a/theforeman.org/yaml/jobs/tests/katello-pr-test.yaml b/theforeman.org/yaml/jobs/tests/katello-pr-test.yaml deleted file mode 100644 index f1c7502a..00000000 --- a/theforeman.org/yaml/jobs/tests/katello-pr-test.yaml +++ /dev/null @@ -1,18 +0,0 @@ -- job: - name: katello-pr-test - project-type: pipeline - sandbox: true - concurrent: true - properties: - - github: - url: https://github.com/Katello/katello - - tfm-pull-request-build-discarder - triggers: - - github_pr_pipeline: - context: 'katello' - dsl: - !include-raw: - - pipelines/test/testKatello.groovy - - pipelines/lib/rvm.groovy - - pipelines/lib/git.groovy - - pipelines/lib/foreman.groovy diff --git a/theforeman.org/yaml/triggers/github_pr.yaml b/theforeman.org/yaml/triggers/github_pr.yaml index 46813950..98a29a88 100644 --- a/theforeman.org/yaml/triggers/github_pr.yaml +++ b/theforeman.org/yaml/triggers/github_pr.yaml @@ -49,10 +49,3 @@ status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline white-list-target-branches: - rpm/.* - -- trigger: - name: github_pr_pipeline - triggers: - - github-pull-request: - <<: *ghprb_defaults - status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline