Julien Malka
d05fcb7e2c
Some checks failed
Check meta / check_dns (push) Failing after 19s
Check meta / check_meta (push) Successful in 20s
build configuration / build_and_cache_storage01 (push) Failing after 35s
build configuration / build_and_cache_compute01 (push) Failing after 36s
build configuration / build_and_cache_rescue01 (push) Failing after 33s
build configuration / build_and_cache_geo01 (push) Failing after 32s
build configuration / build_and_cache_geo02 (push) Failing after 31s
build configuration / build_and_cache_vault01 (push) Failing after 33s
build configuration / build_and_cache_web01 (push) Failing after 32s
build configuration / build_and_cache_web02 (push) Failing after 33s
lint / check (push) Failing after 28s
build configuration / build_and_cache_krz01 (push) Failing after 1m55s
build configuration / build_and_cache_bridge01 (push) Failing after 33s
31 lines
965 B
Bash
31 lines
965 B
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Copyright: Jade Lovelace <lix@jade.fyi> 2024
|
|
|
|
doChecks() {
|
|
# creates refs in the refs/prefetch/remotes/origin namespace
|
|
echo "Prefetching repo changes..." >&2
|
|
git fetch --quiet --prefetch --no-write-fetch-head origin
|
|
|
|
diffs=$(git rev-list --left-right --count HEAD...refs/prefetch/remotes/origin/main)
|
|
only_in_local=$(echo "$diffs" | cut -f1)
|
|
only_in_main=$(echo "$diffs" | cut -f2)
|
|
|
|
if [[ $only_in_main -gt 0 && ! -v $FORCE_DEPLOY_DGNUM ]]; then
|
|
echo >&2
|
|
echo "Attempting to deploy when main has $only_in_main commits not in your branch!" >&2
|
|
echo "This will probably revert someone's changes. Consider merging them." >&2
|
|
echo "If you really mean it, set the environment variable FORCE_DEPLOY_DGNUM" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $only_in_local -gt 0 ]]; then
|
|
echo "You have $only_in_local commits not yet pushed to main. Reminder to push them after :)" >&2
|
|
fi
|
|
}
|
|
|
|
if [[ $1 == 'apply' ]]; then
|
|
doChecks
|
|
fi
|
|
|
|
exec @colmena@ "$@"
|