From 0b39eeeccb8f2b8efa468fd6769e16f0c347d431 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Fri, 16 Feb 2024 17:16:39 -0500 Subject: [PATCH] config: promote `versionary` key, rework it The versionary FCOS script was one of the few things that differed between FCOS and RHCOS and was awkwardly attached as a hack knob to work. Now, we promote it to a proper key under the `misc` section, with support for stream-level overrides. This is prep for also using a versionary in other streams. The versionary is now part of the source config and cosa knows how to execute it if the `--versionary` argument is passed. --- config.yaml | 3 +-- docs/config.yaml | 7 ++++--- jobs/build.Jenkinsfile | 23 ++++++++++++++--------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/config.yaml b/config.yaml index 81d1f8ac2..db7e5c0f3 100644 --- a/config.yaml +++ b/config.yaml @@ -48,8 +48,6 @@ registry_repos: repo: quay.io/fedora/fedora-coreos-kubevirt tags: ["${STREAM}"] -versionary_hack: true - default_artifacts: all: - metal @@ -112,5 +110,6 @@ clouds: test_architectures: [x86_64, aarch64] misc: + versionary: true generate_release_index: true run_extended_upgrade_test_fcos: true diff --git a/docs/config.yaml b/docs/config.yaml index 3d7d467ad..bd36f54bd 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -37,9 +37,6 @@ hacks: # OPTIONAL: skip UEFI on older RHCOS skip_uefi_tests_on_older_rhcos: true -# OPTIONAL/TEMPORARY: whether to use `versionary` to derive version numbers -versionary_hack: true - # OPTIONAL: coreos-assembler image to build with. Supports ${STREAM} variable. # If unset, defaults to `quay.io/coreos-assembler/coreos-assembler:main`. cosa_img: quay.io/jlebon/coreos-assembler:pr3139-${STREAM} @@ -60,6 +57,8 @@ streams: source_config_ref: main # OPTIONAL: override OS variant to use for this stream variant: rhcos-9.0 + # OPTIONAL: override whether to use a versionary for this stream + versionary: false stable: type: production # OPTIONAL: override cosa image to use for this stream @@ -274,6 +273,8 @@ clouds: # OPTIONAL: miscellaneous options misc: + # OPTIONAL: whether to use a versionary to derive version numbers + versionary: true # OPTIONAL: whether to generate a release index generate_release_index: true # OPTIONAL: whether to run extended upgrade test kola job diff --git a/jobs/build.Jenkinsfile b/jobs/build.Jenkinsfile index 955486b92..6b345c9a1 100644 --- a/jobs/build.Jenkinsfile +++ b/jobs/build.Jenkinsfile @@ -250,13 +250,6 @@ lock(resource: "build-${params.STREAM}") { prevBuildID = shwrapCapture("readlink builds/latest") } - def new_version = "" - if (params.VERSION) { - new_version = params.VERSION - } else if (pipecfg.versionary_hack) { - new_version = shwrapCapture("/usr/lib/coreos-assembler/fcos-versionary") - } - def overrides_fetch_param = "" // fetch from repos for the current build @@ -274,10 +267,22 @@ lock(resource: "build-${params.STREAM}") { if (parent_version != "") { parent_arg = "--parent-build ${parent_version}" } - def version = new_version ? "--version ${new_version}" : "" + def version_arg = "" + if (params.VERSION) { + version_arg = "--version ${params.VERSION}" + } else { + def use_versionary = pipecfg.misc?.versionary + if (stream_info.containsKey('versionary')) { + // stream override always wins + use_versionary = stream_info.versionary + } + if (use_versionary) { + version_arg = "--versionary" + } + } def force = params.FORCE ? "--force" : "" shwrap(""" - cosa build ostree ${strict_build_param} --skip-prune ${force} ${version} ${parent_arg} + cosa build ostree ${strict_build_param} --skip-prune ${force} ${version_arg} ${parent_arg} """) // Insert the parent info into meta.json so we can display it in