Modify scripts to support deployment against ECS

This commit is contained in:
Nick
2023-06-06 15:04:18 +03:00
parent 9c6d962206
commit bfc651252d
2 changed files with 10 additions and 19 deletions

View File

@@ -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

View File

@@ -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