pipeline: targets-compositor: force variable BETA the same for all targets, reading from param/env passed to prepare/gha-matrix step

- this way it's consistent across all artifacts and images
- debs-to-repo-download: fix: use DEB_STORAGE instead of hardcoding output/debs (so BETA=yes works)

also:
- fix `Duplicate oci_target` message in mapper-oci-uptodate
This commit is contained in:
Ricardo Pardini 2023-05-25 15:12:15 +02:00 committed by igorpecovnik
parent 31131fe14e
commit c825966857
3 changed files with 7 additions and 2 deletions

View File

@ -73,7 +73,8 @@ function cli_json_info_run() {
if [[ ! -f "${DEBS_TO_REPO_INFO_FILE}" ]]; then
exit_with_error "debs-to-repo-download :: no ${DEBS_TO_REPO_INFO_FILE} file found; did you restore the pipeline artifacts correctly?"
fi
declare DEBS_OUTPUT_DIR="${DEST}/debs" # @TODO: this is wrong if BETA=yes!!!
declare DEBS_OUTPUT_DIR="${DEB_STORAGE}" # this is different depending if BETA=yes (output/debs-beta) or not (output/debs)
display_alert "Downloading debs to" "${DEBS_OUTPUT_DIR}" "info"
run_host_command_logged mkdir -pv "${DEBS_OUTPUT_DIR}"
run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${INFO_TOOLS_DIR}"/download-debs.py "${DEBS_TO_REPO_INFO_FILE}" "${DEBS_OUTPUT_DIR}"
@ -142,7 +143,9 @@ function cli_json_info_run() {
if [[ ! -f "${TARGETS_OUTPUT_FILE}" ]]; then
display_alert "Generating targets inventory" "targets-compositor" "info"
export TARGETS_BETA="${BETA}" # Read by the Python script, and injected into every target as "BETA=" param.
run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${INFO_TOOLS_DIR}"/targets-compositor.py "${ALL_BOARDS_ALL_BRANCHES_INVENTORY_FILE}" "not_yet_releases.json" "${TARGETS_FILE}" ">" "${TARGETS_OUTPUT_FILE}"
unset TARGETS_BETA
fi
### Images.

View File

@ -150,7 +150,7 @@ for target in targets:
oci_target = target["out"]["artifact_full_oci_target"]
if oci_target in oci_target_map:
log.warning("Duplicate oci_target: {oci_target}")
log.warning(f"Duplicate oci_target: {oci_target}")
continue
oci_target_map[oci_target] = target

View File

@ -109,6 +109,8 @@ for target_name in targets["targets"]:
one_invocation_vars = {}
one_invocation_vars.update(one_expansion["vars"])
one_invocation_vars.update(item)
# Special case for BETA, read this from TARGETS_BETA environment and force it.
one_invocation_vars.update({"BETA": os.environ.get("TARGETS_BETA", "")})
expanded = {"vars": one_invocation_vars, "configs": one_expansion["configs"], "pipeline": one_expansion["pipeline"]}
invocations_dict.append(expanded)