Skip to content

Commit

Permalink
Refactor foreman-packaging-*-release jobs for reuse
Browse files Browse the repository at this point in the history
This introduces a completely reusable
foreman-packaging-{packaging_label}-{version}-release job template. Then
it instantiates the various versions of it.

The design is currently that it creates both koji and copr for nightly,
but only a single rpm instance for releases.

The branch-foreman script is modified to do the right thing.
  • Loading branch information
ekohl committed Nov 16, 2023
1 parent a847a12 commit 42ff27b
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 107 deletions.
2 changes: 2 additions & 0 deletions branch-foreman
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ sed -i "/nightly/i \ \ \ \ \ \ - '${KATELLO_VERSION}'" centos.org/jobs/katello-p

echo "- '${FOREMAN_VERSION}'" >> theforeman.org/yaml/includes/foreman_versions.yaml.inc

echo "- '${FOREMAN_VERSION}'" >> theforeman.org/yaml/includes/foreman_versions_copr.yaml.inc

echo " - '${KATELLO_VERSION}'" >> theforeman.org/yaml/jobs/pipeline/katello-rpm-pipeline.yaml

# TODO This should be a templated pipeline
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
2 changes: 2 additions & 0 deletions theforeman.org/yaml/includes/foreman_versions_koji.yaml.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- '3.7'
- '3.8'
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- github:
url: https://github.com/theforeman/foreman-packaging
triggers:
- github_pr_rpm:
- github_pr_rpm_koji_foreman:
context: 'rpm'
dsl:
!include-raw:
Expand All @@ -28,7 +28,7 @@
- github:
url: https://github.com/theforeman/foreman-packaging
triggers:
- github_pr_rpm_develop:
- github_pr_rpm_copr_foreman:
context: 'rpm-copr'
dsl:
!include-raw:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- github:
url: https://github.com/theforeman/pulpcore-packaging
triggers:
- github_pr_rpm:
- github_pr_rpm_koji_pulpcore:
context: 'rpm'
dsl:
!include-raw:
Expand All @@ -28,7 +28,7 @@
- github:
url: https://github.com/theforeman/pulpcore-packaging
triggers:
- github_pr_rpm_develop:
- github_pr_rpm_copr_pulpcore:
context: 'rpm-copr'
dsl:
!include-raw:
Expand Down

This file was deleted.

80 changes: 80 additions & 0 deletions theforeman.org/yaml/jobs/release/foreman-packaging-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
- job-template:
name: 'foreman-packaging-{packaging_label}-{version}-release'
project-type: pipeline
sandbox: true
concurrent: false
properties:
- github:
url: https://github.com/theforeman/foreman-packaging
triggers:
- github
dsl:
!include-raw:
- 'pipelines/vars/foreman/{version}.groovy'
- 'pipelines/release/foreman_packaging_{packaging_type}_release.groovy{empty}'
- 'pipelines/lib/git.groovy{empty}'
- 'pipelines/lib/ansible.groovy{empty}'
- 'pipelines/lib/obal.groovy{empty}'
- 'pipelines/lib/packaging.groovy{empty}'
- 'pipelines/lib/foreman_infra.groovy{empty}'

- project:
name: foreman-packaging-deb
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: deb
packaging_type: deb
version:
!include: ../../includes/foreman_versions.yaml.inc

- project:
name: foreman-packaging-rpm-koji-release
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: rpm
packaging_type: rpm
version:
!include: ../../includes/foreman_versions_koji.yaml.inc

- project:
name: foreman-packaging-rpm-copr-release
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: rpm
packaging_type: rpm_copr
version:
!include: ../../includes/foreman_versions_copr.yaml.inc

- project:
name: foreman-packaging-deb-nightly
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: deb
packaging_type: deb
version:
- 'nightly'

- project:
name: foreman-packaging-rpm-koji-nightly
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: rpm
packaging_type: rpm
version:
- 'nightly'

- project:
name: foreman-packaging-rpm-copr-nightly
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: rpm-copr
packaging_type: rpm_copr
version:
- 'nightly'

This file was deleted.

27 changes: 24 additions & 3 deletions theforeman.org/yaml/triggers/github_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,42 @@
- deb/.*

- trigger:
name: github_pr_rpm
name: github_pr_rpm_koji_foreman
triggers:
- github-pull-request:
<<: *ghprb_defaults
status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline
white-list-target-branches:
- rpm/.*
- rpm/3\.[0-8]+

- trigger:
name: github_pr_rpm_develop
name: github_pr_rpm_koji_pulpcore
triggers:
- github-pull-request:
<<: *ghprb_defaults
status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline
white-list-target-branches:
- rpm/3\.[0-2][0-9]

- trigger:
name: github_pr_rpm_copr_foreman
triggers:
- github-pull-request:
<<: *ghprb_defaults
status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline
white-list-target-branches:
- rpm/3\.9
- rpm/3\.1[0-9]+
- rpm/develop

- trigger:
name: github_pr_rpm_copr_pulpcore
triggers:
- github-pull-request:
<<: *ghprb_defaults
status-url: https://ci.theforeman.org/blue/organizations/jenkins/$JOB_NAME/detail/$JOB_NAME/$BUILD_ID/pipeline
white-list-target-branches:
- rpm/3\.[3-9][0-9]
- rpm/develop

- trigger:
Expand Down

0 comments on commit 42ff27b

Please sign in to comment.