Compute snap channel using ci/channel-info.sh

This commit is contained in:
Michael Vines 2018-08-17 21:16:04 -07:00
parent 3d1e908dad
commit 877920e61b
1 changed files with 10 additions and 7 deletions

View File

@ -7,18 +7,21 @@ if [[ -z $BUILDKITE_BRANCH ]] || ./ci/is-pr.sh; then
DRYRUN="echo" DRYRUN="echo"
fi fi
# BUILDKITE_TAG is the normal environment variable set by Buildkite. However eval "$(ci/channel-info.sh)"
# when this script is run from a triggered pipeline, TRIGGERED_BUILDKITE_TAG is
# used instead of BUILDKITE_TAG (due to Buildkite limitations that prevents if [[ $BUILDKITE_BRANCH = "$STABLE_CHANNEL" ]]; then
# BUILDKITE_TAG from propagating through to triggered pipelines)
if [[ -n "$BUILDKITE_TAG" || -n "$TRIGGERED_BUILDKITE_TAG" ]]; then
SNAP_CHANNEL=stable SNAP_CHANNEL=stable
elif [[ $BUILDKITE_BRANCH = master ]]; then elif [[ $BUILDKITE_BRANCH = "$EDGE_CHANNEL" ]]; then
SNAP_CHANNEL=edge SNAP_CHANNEL=edge
else elif [[ $BUILDKITE_BRANCH = "$BETA_CHANNEL" ]]; then
SNAP_CHANNEL=beta SNAP_CHANNEL=beta
fi fi
if [[ -z $SNAP_CHANNEL ]]; then
echo Unable to determine channel to publish into, exiting.
exit 0
fi
if [[ -z $DRYRUN ]]; then if [[ -z $DRYRUN ]]; then
[[ -n $SNAPCRAFT_CREDENTIALS_KEY ]] || { [[ -n $SNAPCRAFT_CREDENTIALS_KEY ]] || {
echo SNAPCRAFT_CREDENTIALS_KEY not defined echo SNAPCRAFT_CREDENTIALS_KEY not defined