diff --git a/deploy-cluster-aws/awsdeploy_servers.sh b/deploy-cluster-aws/awsdeploy_servers.sh index 538d7727..1e053c93 100755 --- a/deploy-cluster-aws/awsdeploy_servers.sh +++ b/deploy-cluster-aws/awsdeploy_servers.sh @@ -4,32 +4,27 @@ # if any command has a non-zero exit status set -e -function printErr() - { - echo "usage: ./awsdeploy_servers.sh " - echo "No argument $1 supplied" - } +USAGE="usage: ./awsdeploy_servers.sh " + +# Auto-generate the tag to apply to all nodes in the cluster +TAG="bcdb-"`date +%m-%d@%H:%M` +echo "TAG = "$TAG if [ -z "$1" ]; then - printErr "" + echo $USAGE + echo "No first argument was specified" exit 1 +else + NUM_NODES=$1 fi -if [ -z "$2" ]; then - printErr "" - exit 1 -fi - -TAG=$1 -NUM_NODES=$2 - -# If they don't include a third argument () +# If they don't include a second argument () # then assume BRANCH = "pypi" by default -if [ -z "$3" ]; then - echo "No third argument was specified, so BigchainDB will be installed from PyPI" +if [ -z "$2" ]; then + echo "No second argument was specified, so BigchainDB will be installed from PyPI" BRANCH="pypi" else - BRANCH=$3 + BRANCH=$2 fi # Check for AWS private key file (.pem file) diff --git a/docs/source/deploy-on-aws.md b/docs/source/deploy-on-aws.md index d4f25e41..6692e5c1 100644 --- a/docs/source/deploy-on-aws.md +++ b/docs/source/deploy-on-aws.md @@ -103,22 +103,22 @@ You can look inside those files if you're curious. In step 2, they'll be modifie Step 2 is to launch the nodes ("instances") on AWS, to install all the necessary software on them, configure the software, run the software, and more. -Here's an example of how one could launch a BigchainDB cluster of three (3) nodes tagged `wrigley` on AWS: +Here's an example of how one could launch a BigchainDB cluster of three (3) nodes on AWS: ```text # in a Python 2.5-2.7 virtual environment where fabric, boto3, etc. are installed cd bigchaindb cd deploy-cluster-aws -./awsdeploy_servers.sh wrigley 3 pypi +./awsdeploy_servers.sh 3 pypi ``` The `pypi` on the end means that it will install the latest (stable) `bigchaindb` package from the [Python Package Index (PyPI)](https://pypi.python.org/pypi). That is, on each node, BigchainDB is installed using `pip install bigchaindb`. `awsdeploy_servers.sh` is a Bash script which calls some Python and Fabric scripts. The usage is: ```text -./awsdeploy_servers.sh +./awsdeploy_servers.sh ``` -The first two arguments are self-explanatory. The third argument can be `pypi` or the name of a local Git branch (e.g. `master` or `feat/3752/quote-asimov-on-tuesdays`). If you don't include a third argument, then `pypi` will be assumed by default. +The first argument is the number of nodes to deploy. The second argument can be `pypi` or the name of a local Git branch (e.g. `master` or `feat/3752/quote-asimov-on-tuesdays`). If you don't include a second argument, then `pypi` will be assumed by default. If you're curious what the `awsdeploy_servers.sh` script does, the source code has lots of explanatory comments, so it's quite easy to read. Here's a link to the latest version on GitHub: [`awsdeploy_servers.sh`](https://github.com/bigchaindb/bigchaindb/blob/master/deploy-cluster-aws/awsdeploy_servers.sh)