User-initiated builds now select the correct channel

This commit is contained in:
Michael Vines 2019-01-22 14:16:29 -08:00
parent fcda94b673
commit e3ae10bacc
No known key found for this signature in database
GPG Key ID: 33F4FDEC4E0E88BD
1 changed files with 7 additions and 7 deletions

View File

@ -8,11 +8,11 @@ if [[ -z $BUILDKITE ]]; then
exit 1
fi
if [[ -z $CHANNEL ]]; then
CHANNEL=$(buildkite-agent meta-data get "channel" --default "")
if [[ -z $PUBLISH_CHANNEL ]]; then
PUBLISH_CHANNEL=$(buildkite-agent meta-data get "channel" --default "")
fi
if [[ -z $CHANNEL ]]; then
if [[ -z $PUBLISH_CHANNEL ]]; then
(
cat <<EOF
steps:
@ -37,7 +37,7 @@ fi
ci/channel-info.sh
eval "$(ci/channel-info.sh)"
case $CHANNEL in
case $PUBLISH_CHANNEL in
edge)
CHANNEL_BRANCH=$EDGE_CHANNEL
;;
@ -52,7 +52,7 @@ stable)
fi
;;
*)
echo "Error: Invalid CHANNEL=$CHANNEL"
echo "Error: Invalid PUBLISH_CHANNEL=$PUBLISH_CHANNEL"
exit 1
;;
esac
@ -67,11 +67,11 @@ steps:
message: "$BUILDKITE_MESSAGE"
branch: "$CHANNEL_BRANCH"
env:
CHANNEL: "$CHANNEL"
PUBLISH_CHANNEL: "$PUBLISH_CHANNEL"
EOF
) | buildkite-agent pipeline upload
exit 0
fi
set -x
exec metrics/publish-metrics-dashboard.sh "$CHANNEL"
exec metrics/publish-metrics-dashboard.sh "$PUBLISH_CHANNEL"