release.yml 667 B

123456789101112131415
  1. version: 0.2
  2. phases:
  3. build:
  4. commands:
  5. - docker login -u AWS -p $(aws ecr get-login-password --region $AWS_REGION) $ECR_ENDPOINT
  6. - docker pull $ECR_IMAGE_URL:$PREVIOUS_STAGE_NAME
  7. - docker tag $ECR_IMAGE_URL:$PREVIOUS_STAGE_NAME $ECR_IMAGE_URL:$STAGE_NAME
  8. - docker push $ECR_IMAGE_URL:$STAGE_NAME
  9. post_build:
  10. on-failure: CONTINUE
  11. commands:
  12. - aws ecs update-service --service $SERVICE_NAME --cluster $CLUSTER_ARN --force-new-deployment
  13. - aws ecs wait services-stable --service $SERVICE_NAME --cluster $CLUSTER_ARN
  14. finally:
  15. - aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths "/*"