-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdeploy-webapp.sh
More file actions
23 lines (17 loc) · 837 Bytes
/
Copy pathdeploy-webapp.sh
File metadata and controls
23 lines (17 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REVISION=$1
if [ -z "$REVISION"]; then
echo "No revision specified!"
exit 1
fi
STACK_OUTPUTS=`aws cloudformation describe-stacks --stack-name webapp-example --query "Stacks[0].Outputs[].[OutputValue]" --output text`
DEPLOYMENT_BUCKET=`echo "$STACK_OUTPUTS" | grep webappdeploymentbucket`
DEPLOYMENT_GROUP=`echo "$STACK_OUTPUTS" | grep WebappDeploymentGroup`
APPLICATION_NAME=`echo "$STACK_OUTPUTS" | grep WebappApplication`
aws deploy push --application-name $APPLICATION_NAME \
--s3-location s3://$DEPLOYMENT_BUCKET/$REVISION \
--source $DIR/../webapp > /dev/null
aws deploy create-deployment --application-name $APPLICATION_NAME \
--s3-location bucket="$DEPLOYMENT_BUCKET",key="$REVISION",bundleType=zip \
--deployment-group-name $DEPLOYMENT_GROUP