#!/bin/bash -eo pipefail
export PIP=$(which pip pip3 | head -1)
if [[ -n $PIP ]]; then
if which sudo > /dev/null; then
sudo $PIP install awscli --upgrade
else
# This installs the AWS CLI to ~/.local/bin. Make sure that ~/.local/bin is in your $PATH.
$PIP install awscli --upgrade --user
fi
elif [[ $(which unzip curl | wc -l) -eq 2 ]]; then
cd
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
if which sudo > /dev/null; then
sudo ~/awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
else
# This installs the AWS CLI to the default location (~/.local/lib/aws) and create a symbolic link (symlink) at ~/bin/aws. Make sure that ~/bin is in your $PATH.
awscli-bundle/install -b ~/bin/aws
fi
rm -rf awscli-bundle*
cd -
else
echo "Unable to install AWS CLI. Please install pip."
exit 1
fi
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.0M 100 11.0M 0 0 61.3M 0 --:--:-- --:--:-- --:--:-- 61.5M
Archive: awscli-bundle.zip
inflating: awscli-bundle/install
inflating: awscli-bundle/packages/s3transfer-0.2.0.tar.gz
inflating: awscli-bundle/packages/colorama-0.3.9.tar.gz
inflating: awscli-bundle/packages/argparse-1.2.1.tar.gz
inflating: awscli-bundle/packages/pyasn1-0.4.5.tar.gz
inflating: awscli-bundle/packages/urllib3-1.22.tar.gz
inflating: awscli-bundle/packages/botocore-1.12.133.tar.gz
inflating: awscli-bundle/packages/awscli-1.16.143.tar.gz
inflating: awscli-bundle/packages/docutils-0.14.tar.gz
inflating: awscli-bundle/packages/six-1.12.0.tar.gz
inflating: awscli-bundle/packages/urllib3-1.24.2.tar.gz
inflating: awscli-bundle/packages/PyYAML-3.13.tar.gz
inflating: awscli-bundle/packages/rsa-3.4.2.tar.gz
inflating: awscli-bundle/packages/simplejson-3.3.0.tar.gz
inflating: awscli-bundle/packages/python-dateutil-2.6.1.tar.gz
inflating: awscli-bundle/packages/futures-3.2.0.tar.gz
inflating: awscli-bundle/packages/virtualenv-15.1.0.tar.gz
inflating: awscli-bundle/packages/ordereddict-1.1.tar.gz
inflating: awscli-bundle/packages/jmespath-0.9.4.tar.gz
inflating: awscli-bundle/packages/python-dateutil-2.8.0.tar.gz
inflating: awscli-bundle/packages/setup/setuptools_scm-1.15.7.tar.gz
Running cmd: /usr/bin/python virtualenv.py --no-download --python /usr/bin/python /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-cache-dir --no-index --find-links file:///home/circleci/awscli-bundle/packages/setup setuptools_scm-1.15.7.tar.gz
Running cmd: /usr/local/aws/bin/pip install --no-cache-dir --no-index --find-links file:///home/circleci/awscli-bundle/packages awscli-1.16.143.tar.gz
Traceback (most recent call last):
File "/home/circleci/awscli-bundle/install", line 162, in <module>
main()
File "/home/circleci/awscli-bundle/install", line 151, in main
pip_install_packages(opts.install_dir)
File "/home/circleci/awscli-bundle/install", line 119, in pip_install_packages
pip_script, PACKAGES_DIR, cli_tarball))
File "/home/circleci/awscli-bundle/install", line 49, in run
p.returncode, cmd, stdout + stderr))
__main__.BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/pip install --no-cache-dir --no-index --find-links file:///home/circleci/awscli-bundle/packages awscli-1.16.143.tar.gz': Processing ./awscli-1.16.143.tar.gz
Collecting botocore==1.12.133 (from awscli==1.16.143)
Collecting colorama<=0.3.9,>=0.2.5 (from awscli==1.16.143)
Collecting docutils>=0.10 (from awscli==1.16.143)
Collecting rsa<=3.5.0,>=3.1.2 (from awscli==1.16.143)
Collecting s3transfer<0.3.0,>=0.2.0 (from awscli==1.16.143)
Collecting PyYAML<=3.13,>=3.10 (from awscli==1.16.143)
Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.12.133->awscli==1.16.143)
Collecting python-dateutil<3.0.0,>=2.1 (from botocore==1.12.133->awscli==1.16.143)
Collecting urllib3<1.25,>=1.20 (from botocore==1.12.133->awscli==1.16.143)
Collecting pyasn1>=0.1.3 (from rsa<=3.5.0,>=3.1.2->awscli==1.16.143)
Collecting futures<4.0.0,>=2.2.0 (from s3transfer<0.3.0,>=0.2.0->awscli==1.16.143)
Collecting six>=1.5 (from python-dateutil<3.0.0,>=2.1->botocore==1.12.133->awscli==1.16.143)
Installing collected packages: jmespath, docutils, six, python-dateutil, urllib3, botocore, colorama, pyasn1, rsa, futures, s3transfer, PyYAML, awscli
Running setup.py install for jmespath: started
Running setup.py install for jmespath: finished with status 'done'
Running setup.py install for docutils: started
Running setup.py install for docutils: finished with status 'done'
Running setup.py install for six: started
Running setup.py install for six: finished with status 'done'
Running setup.py install for python-dateutil: started
Running setup.py install for python-dateutil: finished with status 'done'
Running setup.py install for urllib3: started
Running setup.py install for urllib3: finished with status 'done'
Running setup.py install for botocore: started
Running setup.py install for botocore: finished with status 'done'
Running setup.py install for colorama: started
Running setup.py install for colorama: finished with status 'done'
Running setup.py install for pyasn1: started
Running setup.py install for pyasn1: finished with status 'done'
Running setup.py install for rsa: started
Running setup.py install for rsa: finished with status 'done'
Running setup.py install for futures: started
Running setup.py install for futures: finished with status 'done'
Running setup.py install for s3transfer: started
Running setup.py install for s3transfer: finished with status 'done'
Running setup.py install for PyYAML: started
Running setup.py install for PyYAML: finished with status 'error'
Complete output from command /usr/local/aws/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zNCc9_/PyYAML/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6Va42O-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/aws/include/site/python2.7/PyYAML:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/composer.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/constructor.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/loader.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/reader.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/parser.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/cyaml.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/tokens.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/representer.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/dumper.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/scanner.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/error.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/nodes.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/serializer.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/events.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/emitter.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/resolver.py -> build/lib.linux-x86_64-2.7/yaml
copying lib/yaml/__init__.py -> build/lib.linux-x86_64-2.7/yaml
running build_ext
creating build/temp.linux-x86_64-2.7
checking if libyaml is compilable
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c build/temp.linux-x86_64-2.7/check_libyaml.c -o build/temp.linux-x86_64-2.7/check_libyaml.o
checking if libyaml is linkable
x86_64-linux-gnu-gcc -pthread build/temp.linux-x86_64-2.7/check_libyaml.o -lyaml -o build/temp.linux-x86_64-2.7/check_libyaml
building '_yaml' extension
creating build/temp.linux-x86_64-2.7/ext
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c ext/_yaml.c -o build/temp.linux-x86_64-2.7/ext/_yaml.o
ext/_yaml.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/aws/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zNCc9_/PyYAML/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-6Va42O-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/aws/include/site/python2.7/PyYAML" failed with error code 1 in /tmp/pip-build-zNCc9_/PyYAML/
Exited with code 1
version: 2.1
orbs:
aws-cli: circleci/[email protected]
jobs:
myjob:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- aws-cli/install