From 5a7d9356924d775ec626ba0b48b649f389bd2327 Mon Sep 17 00:00:00 2001 From: Karl Rister Date: Thu, 22 Aug 2024 15:23:15 -0500 Subject: [PATCH] update the install-crucible action to set workshop.force-builds="true" if a CI built controller is used - We need to ensure that the CI controller is fully tested by building images. - Without this change it is possible that the CI controller will not have to build any images and then it won't be fully tested. This can happen since it's possible for all the necessary images to already exist and recent changes such as expiration refresh make that more likely than ever. --- .../install-crucible/install-crucible.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/actions/install-crucible/install-crucible.sh b/.github/actions/install-crucible/install-crucible.sh index d39c6e7..ef7d0f7 100755 --- a/.github/actions/install-crucible/install-crucible.sh +++ b/.github/actions/install-crucible/install-crucible.sh @@ -210,6 +210,27 @@ start_github_group "rickshaw-settings updates" RICKSHAW_SETTINGS_FILE="/opt/crucible/subprojects/core/rickshaw/rickshaw-settings.json" UPDATES_REQUIRED=0 +if [ "${CI_CONTROLLER}" == "yes" ]; then + UPDATES_REQUIRED=1 + FORCE_BUILDS="true" + echo "Updating rickshaw-settings value workshop.force-builds to '${FORCE_BUILDS}' in ${RICKSHAW_SETTINGS_FILE}" + + if jq --indent 4 --arg force_builds "${FORCE_BUILDS}" \ + '.workshop."force-builds" = $force_builds' \ + ${RICKSHAW_SETTINGS_FILE} > ${RICKSHAW_SETTINGS_FILE}.tmp; then + if mv ${RICKSHAW_SETTINGS_FILE}.tmp ${RICKSHAW_SETTINGS_FILE}; then + echo "Successfully updated:" + jq --indent 4 . ${RICKSHAW_SETTINGS_FILE} + else + echo "ERROR: Failed to move force-builds" + exit 1 + fi + else + echo "ERROR: Failed to update force-builds" + exit 1 + fi +fi + if [ "${AUTH_TOKEN_FILE_FOUND}" == 1 -a "${AUTH_TOKEN_TYPE}" == "PRODUCTION" ]; then UPDATES_REQUIRED=1 EXPIRATION_LENGTH="52w"