diff --git a/.github/scripts/build.sh b/.github/scripts/build.sh index 0d3b359..d473ec5 100755 --- a/.github/scripts/build.sh +++ b/.github/scripts/build.sh @@ -1,6 +1,8 @@ #!/bin/bash -egrep build.*true .killswitch || exit 0 +build=$1 + +[ $build = "enable" ] || exit 0 aws ecr get-login-password --region eu-central-1 | docker login --username AWS --password-stdin 490752553772.dkr.ecr.eu-central-1.amazonaws.com diff --git a/.github/scripts/deploy.sh b/.github/scripts/deploy.sh index 75089de..a39ed36 100755 --- a/.github/scripts/deploy.sh +++ b/.github/scripts/deploy.sh @@ -1,21 +1,10 @@ #!/bin/bash -set -x +set -ex -COMMIT_HASH=$(git rev-parse HEAD) -DEPLOY_ID=$(aws deploy create-deployment --application-name bandada --deployment-group-name bandada-group --github-location repository=$GITHUB_REPOSITORY,commitId=$COMMIT_HASH --ignore-application-stop-failures --file-exists OVERWRITE --output text) - -while true; do - STATUS=$(aws deploy get-deployment --deployment-id $DEPLOY_ID --query 'deploymentInfo.status' --output text) - if [ $STATUS != "InProgress" ] && [ $STATUS != "Created" ]; then - if [ $STATUS = "Succeeded" ]; then - echo "SUCCESS" - exit 0 - else - echo "Failed" - exit 1 - fi - else - echo "Deploying..." - fi - sleep 30 +tasks="bandada-client bandada-api bandada-dashboard" +for task in $tasks; do + bandada_revision=$(aws ecs describe-task-definition --task-definition $task --query "taskDefinition.revision") + aws ecs update-service --cluster bandada --service $task --force-new-deployment --task-definition $task:$bandada_revision done + +aws ecs wait services-stable --cluster bandada --services $tasks