From 5d206765aacd30b1ca280e08ec083fca0da4a835 Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Fri, 16 Jul 2021 18:40:26 +0300 Subject: [PATCH] Use python3 to install aws-cli V1 (#3740) * Starting from version 1.20 aws-cli dropped python2 support --- images/linux/scripts/installers/aws.sh | 3 ++- images/linux/ubuntu1804.json | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/images/linux/scripts/installers/aws.sh b/images/linux/scripts/installers/aws.sh index 5bfab832c..337569dba 100644 --- a/images/linux/scripts/installers/aws.sh +++ b/images/linux/scripts/installers/aws.sh @@ -15,10 +15,11 @@ if isUbuntu20 ; then /tmp/aws/install -i /usr/local/aws-cli -b /usr/local/bin fi +# The installation should be run after python3 is installed as aws-cli V1 dropped python2 support if isUbuntu16 || isUbuntu18 ; then download_with_retries "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" "/tmp" "awscli-bundle.zip" unzip -qq /tmp/awscli-bundle.zip -d /tmp - /tmp/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws + python3 /tmp/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws fi download_with_retries "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" "/tmp" "session-manager-plugin.deb" diff --git a/images/linux/ubuntu1804.json b/images/linux/ubuntu1804.json index a91430fd9..6841b6180 100644 --- a/images/linux/ubuntu1804.json +++ b/images/linux/ubuntu1804.json @@ -199,7 +199,6 @@ "{{template_dir}}/scripts/installers/bicep.sh", "{{template_dir}}/scripts/installers/aliyun-cli.sh", "{{template_dir}}/scripts/installers/apache.sh", - "{{template_dir}}/scripts/installers/aws.sh", "{{template_dir}}/scripts/installers/clang.sh", "{{template_dir}}/scripts/installers/swift.sh", "{{template_dir}}/scripts/installers/cmake.sh", @@ -250,7 +249,8 @@ "{{template_dir}}/scripts/installers/android.sh", "{{template_dir}}/scripts/installers/yq.sh", "{{template_dir}}/scripts/installers/pypy.sh", - "{{template_dir}}/scripts/installers/python.sh" + "{{template_dir}}/scripts/installers/python.sh", + "{{template_dir}}/scripts/installers/aws.sh" ], "environment_vars": [ "HELPER_SCRIPTS={{user `helper_script_folder`}}",