Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Override server name when launching an EC2 #2

Merged
merged 2 commits into from

2 participants

@jbabe

It's a bit of a hack but this change lets me do this:
export TAG=jordans-awesome-server bin/pave launch

probably should be something like this in the future (but I'm leaving for the weekend):

bin/pave launch --name jordans-awesome-server

@jbabe jbabe referenced this pull request in mm53bar/plow
Merged

More debugging and use new tag #6

@mm53bar
Owner

Looks good. I agree that it makes sense to do a proper name argument. And thanks for updating the "name" to "Name" for the ec2 tag.

@mm53bar mm53bar merged commit 25a8139 into mm53bar:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 5 deletions.
  1. +7 −5 bin/pave
View
12 bin/pave
@@ -67,15 +67,17 @@ if [ $LAUNCH ]; then
[[ -n $INSTANCE_TYPE && $REGION && $KEYPAIR && $AMI ]] || bail "invalid config"
- TAG=${PWD##*/}
- [[ $ROLE ]] && TAG+="_$ROLE"
- TAG+="_$ENVIRONMENT"
+ if [ ! $TAG ]; then
+ TAG=${PWD##*/}
+ [[ $ROLE ]] && TAG+="_$ROLE"
+ TAG+="_$ENVIRONMENT"
+ fi
EC2_RUN_RESULT=$(ec2-run-instances --instance-type $INSTANCE_TYPE --group default --region $REGION --key $KEYPAIR $AMI)
INSTANCE_NAME=$(echo ${EC2_RUN_RESULT} | sed 's/RESERVATION.*INSTANCE //' | sed 's/ .*//')
- ec2-create-tags $INSTANCE_NAME --tag "name=$TAG"
-
+ ec2-create-tags $INSTANCE_NAME --tag "Name=$TAG"
+
TOTAL_TIME=0
MAX_TIME=181
while [ $MAX_TIME -gt $TOTAL_TIME ] && ! ec2-describe-instances $INSTANCE_NAME | grep -q "running"
Something went wrong with that request. Please try again.