github.com/souleb/helm@v3.0.0-beta.3+incompatible/.circleci/deploy.sh (about)

     1  #!/usr/bin/env bash
     2  
     3  # Copyright The Helm Authors.
     4  #
     5  # Licensed under the Apache License, Version 2.0 (the "License");
     6  # you may not use this file except in compliance with the License.
     7  # You may obtain a copy of the License at
     8  #
     9  #     http://www.apache.org/licenses/LICENSE-2.0
    10  #
    11  # Unless required by applicable law or agreed to in writing, software
    12  # distributed under the License is distributed on an "AS IS" BASIS,
    13  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  # See the License for the specific language governing permissions and
    15  # limitations under the License.
    16  set -euo pipefail
    17  
    18  # Skip on pull request builds
    19  if [[ -n "${CIRCLE_PR_NUMBER:-}" ]]; then
    20    exit
    21  fi
    22  
    23  : ${AZURE_STORAGE_CONNECTION_STRING:?"AZURE_STORAGE_CONNECTION_STRING environment variable is not set"}
    24  : ${AZURE_STORAGE_CONTAINER_NAME:?"AZURE_STORAGE_CONTAINER_NAME environment variable is not set"}
    25  
    26  VERSION=
    27  if [[ -n "${CIRCLE_TAG:-}" ]]; then
    28    VERSION="${CIRCLE_TAG}"
    29  elif [[ "${CIRCLE_BRANCH:-}" == "master" ]]; then
    30    VERSION="canary"
    31  elif [[ "${CIRCLE_BRANCH:-}" == "dev-v3" ]]; then
    32    VERSION="dev-v3"
    33  else
    34    echo "Skipping deploy step; this is neither a releasable branch or a tag"
    35    exit
    36  fi
    37  
    38  echo "Installing Azure CLI"
    39  echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ stretch main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
    40  curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add
    41  sudo apt install apt-transport-https
    42  sudo apt update
    43  sudo apt install azure-cli
    44  
    45  
    46  echo "Building helm binaries"
    47  make build-cross
    48  make dist checksum VERSION="${VERSION}"
    49  
    50  echo "Pushing binaries to Azure"
    51  az storage blob upload-batch -s _dist/ -d "$AZURE_STORAGE_CONTAINER_NAME" --pattern 'helm-*' --connection-string "$AZURE_STORAGE_CONNECTION_STRING"