diff options
author | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2011-06-21 18:47:36 +0300 |
---|---|---|
committer | Paul Sokolovsky <paul.sokolovsky@linaro.org> | 2011-06-21 18:47:36 +0300 |
commit | 1be0a03a676811033395012ef4c2434d091b15ea (patch) | |
tree | fa6b90897a72751b2e4d6ed69163869461124f28 /control/start-instance | |
parent | fdbb91f82b071db8ddfd2e7f8bc8ca156086dd1a (diff) |
Factor out EC2 parameters used to create master node, document them in-place.
Split EC2 params to sandbox-create.conf, add in-place docs there, to not
crowd README. Still, tweak README for better readability.
Diffstat (limited to 'control/start-instance')
-rwxr-xr-x | control/start-instance | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/control/start-instance b/control/start-instance index a6be823..9b337a5 100755 --- a/control/start-instance +++ b/control/start-instance @@ -10,14 +10,13 @@ # Script/functions to create EC2 instance and make sure it's running # -AMI=ami-e2af508b -TYPE="-t m1.small" -SEC_GROUPS="-g git-mirror -g jenkins-master" - function ec2_create_instance() { local keypair=$1 + local ami=$2 + local instance_type=$3 + local security_groups="$4" echo "Creating instance..." - local cmd="ec2-run-instances $AMI -k $keypair $TYPE $SEC_GROUPS" + local cmd="ec2-run-instances $ami -k $keypair -t $instance_type $security_groups" # echo $cmd instance_id=`$cmd | grep ^INSTANCE | cut -f2` if [ -z "$instance_id" ]; then @@ -64,7 +63,7 @@ function ec2_wait_till_booted() { } function ec2_start_instance() { - ec2_create_instance $* + ec2_create_instance "$1" "$2" "$3" "$4" ec2_wait_till_running $instance_id if ! ec2_wait_till_booted $instance_hostname; then echo "Error starting instance" @@ -75,7 +74,7 @@ function ec2_start_instance() { if [ "$1" != "--include" ]; then if [ "$1" == "" ]; then - echo "Usage: $0 <ec2 keypair name>" + echo "Usage: $0 <ec2 keypair name> <AMI> <instance type> <security groups>" exit fi |