Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Adding AMI option into quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Luo committed Nov 18, 2016
1 parent 58b7116 commit 0263944
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ NB. the instructions will also work in anywhere supported by [Docker Machine](ht
-c <AWS_VPC_ID>
-r <AWS_DEFAULT_REGION>
-z <VPC_AVAIL_ZONE>(optional)
-i <AWS_AMI_ID>(optional)
-a <AWS_ACCESS_KEY>(optional)
-s <AWS_SECRET_ACCESS_EY>(optional)
-s <AWS_SECRET_ACCESS_KEY>(optional)
-u <INITIAL_ADMIN_USER>
-p <INITIAL_ADMIN_PASSWORD>(optional) ...
```
Expand Down
11 changes: 10 additions & 1 deletion quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Usage:
[-z <AVAILABILITY_ZONE_LETTER>]
[-a <AWS_ACCESS_KEY>]
[-s <AWS_SECRET_ACCESS_KEY>]
[-i <AWS_AMI_ID>]
[-u <INITIAL_ADMIN_USER>]
[-p <INITIAL_ADMIN_PASSWORD>]
Expand Down Expand Up @@ -159,12 +160,17 @@ provision_aws() {
--amazonec2-region ${AWS_DEFAULT_REGION}"
fi

if [ -n "${AWS_AMI_ID}" ]; then
MACHINE_CREATE_CMD="${MACHINE_CREATE_CMD} \
--amazonec2-ami ${AWS_AMI_ID}"
fi

MACHINE_CREATE_CMD="${MACHINE_CREATE_CMD} ${MACHINE_NAME}"
${MACHINE_CREATE_CMD}
fi
}

while getopts "t:m:a:s:c:z:r:u:p:" opt; do
while getopts "t:m:a:s:c:z:r:i:u:p:" opt; do
case ${opt} in
t)
export MACHINE_TYPE=${OPTARG}
Expand All @@ -187,6 +193,9 @@ while getopts "t:m:a:s:c:z:r:u:p:" opt; do
r)
export AWS_DEFAULT_REGION=${OPTARG}
;;
i)
export AWS_AMI_ID=${OPTARG}
;;
u)
export INITIAL_ADMIN_USER=${OPTARG}
;;
Expand Down

0 comments on commit 0263944

Please sign in to comment.