-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtravis_build_script.sh
More file actions
executable file
·23 lines (22 loc) · 948 Bytes
/
Copy pathtravis_build_script.sh
File metadata and controls
executable file
·23 lines (22 loc) · 948 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
set -e
mvn package
if [ "$TRAVIS_BRANCH" == "master" ]; then
export CLUSTER=pomodoro-prod #todo create this cluster
export SERVICE=pomodoro-prod
export POMO_PROFILE=default
elif [ "$TRAVIS_BRANCH" == "develop" ]; then
export CLUSTER=pomodoro-dev #todo create this cluster
export SERVICE=pomodoro-dev
export POMO_PROFILE=default
else
export CLUSTER=pomodoro #todo rename cluster to sandbox
export SERVICE=pomodoro
export POMO_PROFILE=default
fi
echo ${POMO_PROFILE}
docker build -t pomodoro-dev . --build-arg POMO_PROFILE=${POMO_PROFILE}
docker tag pomodoro-dev:latest ${AWS_ACCOUNT_ID}.dkr.ecr.ap-southeast-2.amazonaws.com/pomodoro-dev:latest
eval $(aws ecr get-login --no-include-email --region ap-southeast-2)
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.ap-southeast-2.amazonaws.com/pomodoro-dev:latest
aws ecs update-service --cluster ${CLUSTER} --service ${SERVICE} --force-new-deployment