Skip to content

Commit

Permalink
inject foreman version for stable plugin builds
Browse files Browse the repository at this point in the history
this allows to have the same plugin version to have different builds for
different foreman releases, thus making it possible to cleanly upgrade
to plugin builds that match the foreman release even if there are no
plugin version differences.

practical example: foreman_puppet 6.2.0 exists in 3.8, 3.9, 3.10 and
nightly, but in 3.10 and nightly it needs to be built with Webpack5 and
not 3 to work.
before this change, all builds ended up being 6.2.0-1 and apt would not
consider to upgrade those when coming from 3.9 to 3.10, creating a
broken setup.
with this change, the versions would be:
6.2.0-1~fm3.8
6.2.0-1~fm3.9
6.2.0-1~fm3.10
6.2.0-1
which apt will gladly upgrade in that order

It would be cool if we could name the last one 6.2.0-1~3.11, but there
is no way for us to know that the next version will be 3.11 at that
point
  • Loading branch information
evgeni committed Feb 27, 2024
1 parent e6b5377 commit a13893e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions theforeman.org/pipelines/lib/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ def setup_sources_plugin(project, os, version, repoowner, pull_request = false)
last_commit = git_hash()
add_automated_debian_changelog('plugins', package_version, repoowner, last_commit)
}
inject_foreman_release_version(version)
}

return "${build_dir}/${package_dir}"
Expand Down Expand Up @@ -435,6 +436,13 @@ def inject_debian_release_version(os) {
sh(script: "sed -i '1 s/)/${suffix})/' debian/changelog", label: "inject Debian release into package version")
}

def inject_foreman_release_version(version) {
if (version != 'nightly') {
def suffix="~fm${version}"
sh(script: "sed -i '1 s/)/${suffix})/' debian/changelog", label: "inject Foreman release into package version")
}
}

def execute_pbuilder(build_dir, os, version) {
dir(build_dir) {
try {
Expand Down

0 comments on commit a13893e

Please sign in to comment.