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