mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
ci-automation: List built base sysext explicitly
Instead of depending on default value of build_image's base_sysext parameter, create a file that explicitly lists which base sysexts will be built for each architecture. The file can be sourced by other scripts that need this kind of information. Currently, image.sh and image_changes.sh use this file.
This commit is contained in:
parent
dabb54783d
commit
c5b8a80d36
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -283,7 +283,7 @@ jobs:
|
||||
|
||||
declare -a oemids base_sysexts
|
||||
get_oem_id_list . "${arch}" oemids
|
||||
get_base_sysext_list . base_sysexts
|
||||
get_base_sysext_list . "${arch}" base_sysexts
|
||||
generate_image_changes_report \
|
||||
"${version_description}" 'image-changes-reports-release.txt' "../flatcar-build-scripts" \
|
||||
"${package_diff_env[@]}" --- "${package_diff_params[@]}" -- \
|
||||
|
16
ci-automation/base_sysexts.sh
Normal file
16
ci-automation/base_sysexts.sh
Normal file
@ -0,0 +1,16 @@
|
||||
# Definitions of base sysexts to be built, for each arch. Used by
|
||||
# image.sh and image_changes.sh.
|
||||
|
||||
if [[ ${1:-} = 'local' ]]; then
|
||||
local amd64_base_sysexts arm64_base_sysexts
|
||||
fi
|
||||
|
||||
amd64_base_sysexts=(
|
||||
'containerd-flatcar:app-containers/containerd'
|
||||
'docker-flatcar:app-containers/docker'
|
||||
)
|
||||
|
||||
arm64_base_sysexts=(
|
||||
'containerd-flatcar:app-containers/containerd'
|
||||
'docker-flatcar:app-containers/docker'
|
||||
)
|
@ -86,6 +86,10 @@ function _image_build_impl() {
|
||||
|
||||
apply_local_patches
|
||||
|
||||
source ci-automation/base_sysexts.sh 'local'
|
||||
local -n base_sysexts_ref="${arch}_base_sysexts"
|
||||
local base_sysexts_param=$(export IFS=,; echo "${base_sysexts_ref[*]}")
|
||||
|
||||
# build image and related artifacts
|
||||
./run_sdk_container -x ./ci-cleanup.sh -n "${image_container}" -C "${packages_image}" \
|
||||
-v "${vernum}" \
|
||||
@ -96,6 +100,7 @@ function _image_build_impl() {
|
||||
./run_sdk_container -n "${image_container}" -C "${packages_image}" \
|
||||
-v "${vernum}" \
|
||||
./build_image --board="${arch}-usr" --group="${channel}" \
|
||||
--base_sysexts="${base_sysexts_param}" \
|
||||
--output_root="${CONTAINER_IMAGE_ROOT}" \
|
||||
--only_store_compressed \
|
||||
prodtar container
|
||||
|
@ -109,7 +109,7 @@ function image_changes() (
|
||||
echo
|
||||
local -a oemids base_sysexts
|
||||
get_oem_id_list . "${arch}" oemids
|
||||
get_base_sysext_list . base_sysexts
|
||||
get_base_sysext_list . "${arch}" base_sysexts
|
||||
generate_image_changes_report \
|
||||
"${version_description}" '-' "${fbs_repo}" \
|
||||
"${package_diff_env[@]}" --- "${package_diff_params[@]}" -- \
|
||||
@ -262,18 +262,15 @@ function get_oem_id_list() {
|
||||
|
||||
function get_base_sysext_list() {
|
||||
local scripts_repo=${1}; shift
|
||||
local arch=${1}; shift
|
||||
local -n list_var_ref=${1}; shift
|
||||
|
||||
local line
|
||||
line=$({ git -C "${scripts_repo}" grep -F 'DEFINE_string base_sysexts ' | head -n1; } || :)
|
||||
line=${line#*'"'}
|
||||
line=${line%'"'*}
|
||||
source "${scripts_repo}/ci-automation/base_sysexts.sh" 'local'
|
||||
local -n base_sysexts_ref="${arch}_base_sysexts"
|
||||
|
||||
list_var_ref=()
|
||||
local -a entries
|
||||
mapfile -t entries <<<"${line//,/$'\n'}"
|
||||
local entry
|
||||
for entry in "${entries[@]}"; do
|
||||
for entry in "${base_sysexts_ref[@]}"; do
|
||||
list_var_ref+=( "${entry%%:*}" )
|
||||
done
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user