-
Notifications
You must be signed in to change notification settings - Fork 3
/
.travis.yml
23 lines (23 loc) · 1012 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sudo: required
dist: trusty
braches:
only:
-master
-develop-CI
servises:
- docker
before_install:
# set up awscli packages
- pip install --user awscli
- mkdir ~/.aws/
- echo -e "[default]\naws_access_key_id=$AWS_ACCESS_KEY_ID\naws_secret_access_key=$AWS_SECRET_ACCESS_KEY\nregion=$AWS_REGION">~/.aws/config
- login=$(aws ecr get-login --no-include-email --region us-west-2)
- $login
script:
- docker build --build-arg DB_URL=$DATABASE_URL --build-arg DB_USERNAME=$DATABASE_USERNAME --build-arg DB_PASSWORD=$DATABASE_PASSWORD -t d2g_api_repository .
after_success:
- docker tag d2g_api_repository:latest 919834907758.dkr.ecr.us-west-2.amazonaws.com/d2g_api_repository:latest
- docker push 919834907758.dkr.ecr.us-west-2.amazonaws.com/d2g_api_repository:latest
- task_arns_str=$(aws ecs list-tasks --cluster $CLUSTER_NAME | grep -oE arn\:aws\:ecs\:[^\"]*)
- task_arns=($task_arns_str)
- for arn in ${task_arns[@]}; do aws ecs stop-task --cluster $CLUSTER_NAME --task $arn; done