Skip to content

Commit

Permalink
update CI target processing in install-crucible to properly configure…
Browse files Browse the repository at this point in the history
… the JSON config file
  • Loading branch information
k-rister committed Sep 24, 2024
1 parent 7c1b60f commit d38b29b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/actions/install-crucible/install-crucible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,24 @@ if [ "${CI_TARGET}" != "none" -a "${CI_TARGET_DIR}" != "none" ]; then
rm -v $(basename ${STALE_LINK})
echo "Creating new symbolic link:"
ln -sv ${CI_TARGET_DIR} $(basename ${STALE_LINK})
popd > /dev/null

if push ${STALE_LINK} > /dev/null; then
REPO_FILE="/opt/crucible/config/repos.json"
echo "Setting primary-branch and checkout.target for ${CI_TARGET} to 'HEAD' in ${REPO_FILE}"
source /opt/crucible/bin/jqlib
function exit_error() {
echo "ERROR: ${1}"
exit 1
}
jq_update ${REPO_FILE} ${CI_TARGET}:primary-branch --arg repository "$CI_TARGET}" --arg primary_branch "HEAD" '(.official[] | select(.name == $repository) | ."primary-branch") |= $primary_branch'
jq_update ${REPO_FILE} ${CI_TARGET}:checkout.target --arg repository "$CI_TARGET}" --arg checkout_target "HEAD" '(.official[] | select(.name == $repository) | .checkout.target) |= $checkout_target'

popd > /dev/null
else
echo "ERROR: Could not pushd to ${STALE_LINK}"
exit 1
fi
else
echo "ERROR: Could not pushd to $(dirname ${STALE_LINK})"
exit 1
Expand Down

0 comments on commit d38b29b

Please sign in to comment.