Skip to content

Instantly share code, notes, and snippets.

@adikari
Last active December 5, 2020 14:49
Show Gist options
  • Save adikari/743a19873f083761c8b1f7f6c48510e4 to your computer and use it in GitHub Desktop.
Save adikari/743a19873f083761c8b1f7f6c48510e4 to your computer and use it in GitHub Desktop.
Script to deploy buildkite elastic ci stack
#!/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