Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ streams:
type: mechanical
env:
COSA_TESTISO_DEBUG: true
osbuild_experimental: true
# branched:
# type: mechanical
# env:
Expand Down
3 changes: 3 additions & 0 deletions docs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ streams:
check_kernel_rt_mismatch_rhcos: true
# OPTIONAL: list of kola tags to skip for this stream
skip_kola_tags: [openshift, needs-internet, luks]
# OPTIONAL: allow building using OSBuild for artifacts where OSBuild is
# not yet the default in CoreOS Assembler.
osbuild_experimental: true

# REQUIRED: architectures to build for other than x86_64
additional_arches: [aarch64, ppc64le, s390x]
Expand Down
36 changes: 36 additions & 0 deletions utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,42 @@ def build_artifacts(pipecfg, stream, basearch) {
// First get the list of artifacts to build from the config
def artifacts = get_artifacts_to_build(pipecfg, stream, basearch)

// If `cosa osbuild` is supported then let's build what we can using OSBuild
if (shwrapRc("cosa shell -- test -e /usr/lib/coreos-assembler/cmd-osbuild") == 0) {
// Determine which platforms are OSBuild experimental versus
// stable (i.e. the default is to use OSBuild for them).
def experimental = shwrapCapture("cosa osbuild --supported-platforms").tokenize()
def stable = shwrapCapture('''
cosa shell -- bash -c '
for buildextend in /usr/lib/coreos-assembler/cmd-buildextend-*; do
if [ "$(readlink -f ${buildextend})" == "/usr/lib/coreos-assembler/cmd-osbuild" ]; then
# the 42 here chops off /usr/lib/coreos-assembler/cmd-buildextend-
echo "${buildextend:42}"
fi
done
'
''').tokenize('\n')
// Based on the pipeline configuration we'll either use OSBuild for as
// much as we can (experimental) or just what it is the default for (stable)
def osbuild_supported_artifacts = stable
if (pipecfg.streams[stream].osbuild_experimental) {
osbuild_supported_artifacts = experimental
}
// Let's build separately the artifacts that can be built directly with OSBuild.
def osbuild_artifacts = []
for (artifact in artifacts) {
if (artifact in osbuild_supported_artifacts) {
osbuild_artifacts += artifact
}
}
if (!osbuild_artifacts.isEmpty()) {
artifacts.removeAll(osbuild_artifacts)
stage('💽:OSBuild') {
shwrap("cosa osbuild ${osbuild_artifacts.join(' ')}")
}
}
}

// Next let's do some massaging of the inputs based on two problems we
// need to consider:
//
Expand Down