Skip to content

Commit

Permalink
config: promote versionary key, rework it
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlebon authored and aaradhak committed May 14, 2024
1 parent 9cf3560 commit 256a7c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
3 changes: 1 addition & 2 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ registry_repos:
repo: quay.io/fedora/fedora-coreos-kubevirt
tags: ["${STREAM}"]

versionary_hack: true

default_artifacts:
all:
- metal
Expand Down Expand Up @@ -112,5 +110,6 @@ clouds:
test_architectures: [x86_64, aarch64]

misc:
versionary: true
generate_release_index: true
run_extended_upgrade_test_fcos: true
7 changes: 4 additions & 3 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 14 additions & 9 deletions jobs/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 256a7c6

Please sign in to comment.