]> git.lizzy.rs Git - rust.git/blob - src/ci/install-awscli.sh
Rollup merge of #63055 - Mark-Simulacrum:save-analysis-clean-2, r=Xanewok
[rust.git] / src / ci / install-awscli.sh
1 #!/bin/bash
2 # This script downloads and installs awscli from the packages mirrored in our
3 # own S3 bucket. This follows the recommendations at:
4 #
5 #    https://packaging.python.org/guides/index-mirrors-and-caches/#caching-with-pip
6 #
7 # To create a new mirrored copy you can run the command:
8 #
9 #    pip wheel awscli
10 #
11 # Before compressing please make sure all the wheels end with `-none-any.whl`.
12 # If that's not the case you'll need to remove the non-cross-platform ones and
13 # replace them with the .tar.gz downloaded from https://pypi.org. Also make
14 # sure it's possible to call this script with both Python 2 and Python 3.
15
16 set -euo pipefail
17 IFS=$'\n\t'
18
19 MIRROR="https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2019-07-27-awscli.tar"
20 DEPS_DIR="/tmp/awscli-deps"
21
22 pip="pip"
23 pipflags=""
24 if [[ "${AGENT_OS}" == "Linux" ]]; then
25     pip="pip3"
26     pipflags="--user"
27
28     sudo apt-get install -y python3-setuptools
29     echo "##vso[task.prependpath]$HOME/.local/bin"
30 fi
31
32 mkdir -p "${DEPS_DIR}"
33 curl "${MIRROR}" | tar xf - -C "${DEPS_DIR}"
34 "${pip}" install ${pipflags} --no-index "--find-links=${DEPS_DIR}" awscli
35 rm -rf "${DEPS_DIR}"