Skip to content

Commit

Permalink
make verify-channel.sh compatible with macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed May 12, 2021
1 parent 392723e commit a8da333
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/ci/scripts/verify-channel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@ IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

declare -A CHANNEL_BRANCH
CHANNEL_BRANCH["nightly"]="master"
CHANNEL_BRANCH["beta"]="beta"
CHANNEL_BRANCH["stable"]="stable"

if isCiBranch auto || isCiBranch try; then
echo "channel verification is only executed on PR builds"
exit
fi

channel=$(cat "$(ciCheckoutPath)/src/ci/channel")
case "${channel}" in
nightly)
channel_branch="master"
;;
beta)
channel_branch="beta"
;;
stable)
channel_branch="stable"
;;
*)
echo "error: unknown channel defined in src/ci/channel: ${channel}"
exit 1
esac

branch="$(ciBaseBranch)"
if [[ "${branch}" != "${CHANNEL_BRANCH[$channel]}" ]]; then
if [[ "${branch}" != "${channel_branch}" ]]; then
echo "error: PRs changing the \`${channel}\` channel should be sent to the \
\`${CHANNEL_BRANCH[$channel]}\` branch!"
\`${channel_branch}\` branch!"

exit 1
fi

0 comments on commit a8da333

Please sign in to comment.