From 4624b581dae264eaeac8088a097fb0207d5c6df5 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Fri, 4 Aug 2023 19:44:09 +0200 Subject: [PATCH] pipeline: force compositor to include `REVISION=` just like it already did for `BETA=` - this way the prepare step's REVISION (possibly passed via CLI parameter) is always sovereign --- lib/functions/cli/cli-jsoninfo.sh | 4 ++++ lib/tools/info/targets-compositor.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/functions/cli/cli-jsoninfo.sh b/lib/functions/cli/cli-jsoninfo.sh index 5228bfc187..4ffde1bf56 100644 --- a/lib/functions/cli/cli-jsoninfo.sh +++ b/lib/functions/cli/cli-jsoninfo.sh @@ -145,9 +145,12 @@ 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. + export TARGETS_REVISION="${REVISION}" # Read by the Python script, and injected into every target as "REVISION=" param. export TARGETS_FILTER_INCLUDE="${TARGETS_FILTER_INCLUDE}" # Read by the Python script; used to "only include" targets that match the given string. 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 + unset TARGETS_REVISION + unset TARGETS_FILTER_INCLUDE fi ### Images. @@ -217,6 +220,7 @@ function cli_json_info_run() { # 1) getting the artifact from OCI only (not build it) # 2) getting the list of .deb's to be published to the repo for that artifact display_alert "Generating deb-to-repo JSON output" "output-debs-to-repo-json" "info" + # This produces debs-to-repo-info.json run_host_command_logged "${PYTHON3_VARS[@]}" "${PYTHON3_INFO[BIN]}" "${INFO_TOOLS_DIR}"/output-debs-to-repo-json.py "${BASE_INFO_OUTPUT_DIR}" "${OUTDATED_ARTIFACTS_IMAGES_FILE}" if [[ "${ARMBIAN_COMMAND}" == "debs-to-repo-json" ]]; then display_alert "Done with" "output-debs-to-repo-json" "ext" diff --git a/lib/tools/info/targets-compositor.py b/lib/tools/info/targets-compositor.py index 0cbd78ae7c..6a4d934218 100644 --- a/lib/tools/info/targets-compositor.py +++ b/lib/tools/info/targets-compositor.py @@ -119,6 +119,8 @@ for target_name in targets["targets"]: 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", "")}) + # Special case for REVISION, read this from TARGETS_REVISION environment and force it. + one_invocation_vars.update({"REVISION": os.environ.get("TARGETS_REVISION", "")}) expanded = {"vars": one_invocation_vars, "configs": one_expansion["configs"], "pipeline": one_expansion["pipeline"]} invocations_dict.append(expanded)