]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/install-awscli.sh
Merge commit '57b3c4b90f4346b3990c1be387c3b3ca7b78412c' into clippyup
[rust.git] / src / ci / scripts / 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 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
20
21 MIRROR="${MIRRORS_BASE}/2019-07-27-awscli.tar"
22 DEPS_DIR="/tmp/awscli-deps"
23
24 pip="pip"
25 pipflags=""
26 if isLinux; then
27     pip="pip3"
28     pipflags="--user"
29
30     sudo apt-get install -y python3-setuptools python3-wheel
31     ciCommandAddPath "${HOME}/.local/bin"
32 fi
33
34 mkdir -p "${DEPS_DIR}"
35 curl "${MIRROR}" | tar xf - -C "${DEPS_DIR}"
36 "${pip}" install ${pipflags} --no-index "--find-links=${DEPS_DIR}" awscli
37 rm -rf "${DEPS_DIR}"