Skip to content

Commit

Permalink
#97 fix branch and repo flags
Browse files Browse the repository at this point in the history
  • Loading branch information
donsizemore committed Aug 13, 2019
1 parent 9ff1995 commit d187a81
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions ec2/ec2-create-instance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ if [ ! -z "$GRPVRS" ]; then
GVFILE=$(basename "$GRPVRS")
GVARG="-e @$GVFILE"
echo "using $GRPVRS for extra vars"
else
# no group_vars
if [ ! -z "$REPO_URL" ]; then
GVARG+=" -e dataverse_repo=$REPO_URL_DEFAULT"
echo "using $REPO_URL"
fi

if [ ! -z "$BRANCH" ]; then
GVARG+=" -e dataverse_branch=$BRANCH_DEFAULT"
echo "building $BRANCH"
fi
fi

# test for CLI args
if [ ! -z "$REPO_URL" ]; then
GVARG+=" -e dataverse_repo=$REPO_URL"
echo "using repo $REPO_URL"
fi

if [ ! -z "$BRANCH" ]; then
GVARG+=" -e dataverse_branch=$BRANCH"
echo "building branch $BRANCH"
fi

# default to dataverse-ansible/master
Expand All @@ -65,7 +65,6 @@ fi
# ansible doesn't care about pem_dir (yet)
if [ -z "$PEM_DIR" ]; then
PEM_DIR="$PEM_DEFAULT"
echo "using $PEM_DIR"
fi

AWS_CLI_VERSION=$(aws --version)
Expand Down Expand Up @@ -153,6 +152,6 @@ EOF
CLICKABLE_LINK="http://${PUBLIC_DNS}:8080"
echo "To ssh into the new instance:"
echo "ssh -i $PEM_FILE $USER_AT_HOST"
echo "Branch \"$BRANCH\" from $REPO_URL has been deployed to $CLICKABLE_LINK"
echo "Branch $BRANCH from $REPO_URL has been deployed to $CLICKABLE_LINK"
echo "When you are done, please terminate your instance with:"
echo "aws ec2 terminate-instances --instance-ids $INSTANCE_ID"

0 comments on commit d187a81

Please sign in to comment.