Created
May 28, 2018 12:27
-
-
Save ThakurPriyanka/a919072f1c586b45c60b06be777b0439 to your computer and use it in GitHub Desktop.
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
#!/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