From 3ddf4d177495afdae3316d0335f077e3d5b93c6f Mon Sep 17 00:00:00 2001 From: Aaron Schlesinger Date: Fri, 10 Nov 2017 12:16:48 -0800 Subject: [PATCH] Update the Microsoft apt repo receiving key (#37) This fixes the Azure CLI install script --- .circleci/config.yml | 17 +++++++++++++++++ scripts/install-azure-cli.sh | 19 ++++++++++++++++--- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 84a1b8c..617eca4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,6 +19,20 @@ jobs: name: Helm Lint command: ./helm-lint.sh working_directory: scripts + # this step tests the install script for the Azure CLI + test-install-az-cli: + docker: + - image: quay.io/deis/go-dev:v1.2.0 + steps: + - checkout + - run: + name: Install Basic Utilities + command: ./install-base-prereqs.sh + working_directory: scripts + - run: + name: Install the Azure CLI + command: ./install-azure-cli.sh + working_directory: scripts helm-sync: docker: - image: quay.io/deis/go-dev:v1.2.0 @@ -48,6 +62,9 @@ workflows: build: jobs: - build + test-install-az-cli: + jobs: + - test-install-az-cli build-and-deploy: jobs: - build diff --git a/scripts/install-azure-cli.sh b/scripts/install-azure-cli.sh index 08f7dfc..3daa4f1 100755 --- a/scripts/install-azure-cli.sh +++ b/scripts/install-azure-cli.sh @@ -1,8 +1,21 @@ #!/bin/bash -echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | sudo tee /etc/apt/sources.list.d/azure-cli.list -apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893 +# About +# +# This script installs the Azure CLI. It copies the steps from the following link: +# +# https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest +# +# under the "Install with apt package manager" section + +# first do an update and install apt-transport-https +apt-get update apt-get install -y apt-transport-https -# update package lists so we get the Microsoft packages (including azure-cli) + +# the add keys for the MSFT apt repo +echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | tee /etc/apt/sources.list.d/azure-cli.list +apt-key adv --keyserver packages.microsoft.com --recv-keys 52E16F86FEE04B979B07E28DB02C46DF417A0893 + +# then update again and install azure-cli apt-get update apt-get install -y azure-cli