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 15, 2023
1 parent 15a7d61 commit cac4385
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 100 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'

This file was deleted.

72 changes: 72 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,72 @@
---
- 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-nightly
jobs:
- 'foreman-packaging-{packaging_label}-{version}-release'
empty: ''
packaging_label: "{packaging_type}"
packaging_type:
- deb
- rpm
version:
- 'nightly'

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

This file was deleted.

0 comments on commit cac4385

Please sign in to comment.