Last active
December 5, 2020 14:49
-
-
Save adikari/743a19873f083761c8b1f7f6c48510e4 to your computer and use it in GitHub Desktop.
Script to deploy buildkite elastic ci stack
This file contains hidden or 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 -euo pipefail | |
[ -z $BUILDKITE_AGENT_TOKEN ] && { echo "BUILDKITE_AGENT_TOKEN is not set."; exit 1;} | |
CURRENT_DIR=$(pwd) | |
ROOT_DIR="$( dirname "${BASH_SOURCE[0]}" )"/.. | |
PARAMETERS=$(cat ./bin/stack-config | envsubst) | |
cd $ROOT_DIR | |
echo "downloading elastic ci stack template.." | |
curl -s https://s3.amazonaws.com/buildkite-aws-stack/latest/aws-stack.yml -O | |
aws cloudformation deploy \ | |
--capabilities CAPABILITY_NAMED_IAM \ | |
--template-file ./aws-stack.yml \ | |
--stack-name "buildkite-elastic-ci" \ | |
--parameter-overrides $PARAMETERS | |
rm -f aws-stack.yml | |
cd $CURRENT_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment