Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ThakurPriyanka
Created May 28, 2018 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThakurPriyanka/a919072f1c586b45c60b06be777b0439 to your computer and use it in GitHub Desktop.
Save ThakurPriyanka/a919072f1c586b45c60b06be777b0439 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "*** Deployment started"
usage() {
echo "(AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY) to be set"
exit 1
}
if [ ${#} -ne 2 ]; then
usage
fi
ACCESS_KEY=$1
SECRET_KEY=$2
export SSH_KEY_NAME
SSH_KEY_NAME="mykey"
export IMAGE_NAME
IMAGE_NAME="ubuntu-dockers"
sed -i -e "s/ami_image_name/${IMAGE_NAME}/g" terraform/vars.tf
echo "*** starting packer"
sh packer.sh $ACCESS_KEY $SECRET_KEY;
echo "*** starting terraform"
sh terraform.sh;
sed -i -e "s/${IMAGE_NAME}/ami_image_name/g" terraform/vars.tf
echo "*** Deployment complete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment