Last active
December 4, 2019 15:43
-
-
Save davidmukiibi/270f685eb77d8c6c5dcaa70b362c16fa to your computer and use it in GitHub Desktop.
bash scrip to install k6 and aws cli and configure aws cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -ex | |
update_cache() { | |
apt-get update | |
} | |
install_aws_cli() { | |
apt-get install curl unzip python2.7 python-pip -y | |
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
unzip -o awscli-bundle.zip | |
./awscli-bundle/install -b ~/bin/aws | |
} | |
configuring_aws_cli() { | |
/root/bin/aws configure set aws_access_key_id $(AWS_ACCESS_KEY) | |
/root/bin/aws configure set aws_secret_access_key $(AWS_SECRET_ACCESS_KEY) | |
/root/bin/aws configure set default.region us-east-1 | |
/root/bin/aws configure set default.output json | |
} | |
install_k6() { | |
apt-get install dirmngr --install-recommends | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 379CE192D401AB61 | |
echo "deb https://dl.bintray.com/loadimpact/deb stable main" | sudo tee -a /etc/apt/sources.list | |
apt-get update | |
apt-get install k6 | |
} | |
main() { | |
update_cache | |
install_aws_cli | |
configuring_aws_cli | |
update_cache | |
install_k6 | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment