Skip to content

Commit

Permalink
removed CLIENT_NAME variable
Browse files Browse the repository at this point in the history
  • Loading branch information
claisonamorim committed Oct 10, 2019
1 parent 3019a06 commit ad4676a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ERROR=0
if [[ -z "$AWS_DEFAULT_REGION" ]]; then echo "---> ERROR: Missing variable AWS_DEFAULT_REGION"; ERROR=1; fi
if [[ -z "$APP_NAME" ]]; then echo "---> ERROR: Missing variable APP_NAME"; ERROR=1; fi
if [[ -z "$CLUSTER_NAME" ]]; then echo "---> ERROR: Missing variable CLUSTER_NAME"; ERROR=1; fi
if [[ -z "$CLIENT_NAME" ]]; then echo "---> ERROR: Missing variable CLIENT_NAME"; ERROR=1; fi
if [[ -z "$CONTAINER_PORT" ]]; then echo "---> ERROR: Missing variable CONTAINER_PORT"; ERROR=1; fi
if [[ -z "$IMAGE_NAME" ]]; then echo "---> ERROR: Missing variable IMAGE_NAME"; ERROR=1; fi
if [[ "$ERROR" == "1" ]]; then exit 1; fi
Expand All @@ -28,23 +27,19 @@ echo "---> Creating deployment with CodeDeploy"

# Update the ECS service to use the updated Task version
aws ecs deploy \
--service $CLIENT_NAME-$APP_NAME \
--service $APP_NAME \
--task-definition ./task-definition.json \
--cluster $CLUSTER_NAME \
--codedeploy-appspec ./app-spec.json \
--codedeploy-application $CLUSTER_NAME-$CLIENT_NAME-$APP_NAME \
--codedeploy-deployment-group $CLUSTER_NAME-$CLIENT_NAME-$APP_NAME &
--codedeploy-application $CLUSTER_NAME-$APP_NAME \
--codedeploy-deployment-group $CLUSTER_NAME-$APP_NAME &

DEPLOYMENT_PID=$!

sleep 5 # Wait for deployment to be created so we can fetch DEPLOYMENT_ID next

DEPLOYMENT_ID=$(aws deploy list-deployments --application-name=$CLUSTER_NAME-$CLIENT_NAME-$APP_NAME --deployment-group=$CLUSTER_NAME-$CLIENT_NAME-$APP_NAME --max-items=1 --query="deployments[0]" --output=text | head -n 1)
DEPLOYMENT_ID=$(aws deploy list-deployments --application-name=$CLUSTER_NAME-$APP_NAME --deployment-group=$CLUSTER_NAME-$APP_NAME --max-items=1 --query="deployments[0]" --output=text | head -n 1)

echo $DEPLOYMENT_ID
echo $CLIENT_NAME
echo $CLUSTER_NAME
echo $APP_NAME

echo "---> For More Deployment info: https://$AWS_DEFAULT_REGION.console.aws.amazon.com/codesuite/codedeploy/deployments/$DEPLOYMENT_ID"

Expand Down

0 comments on commit ad4676a

Please sign in to comment.