-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.travis.yml
More file actions
56 lines (50 loc) · 1.68 KB
/
Copy path.travis.yml
File metadata and controls
56 lines (50 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
sudo: required
dist: trusty
language: java
services:
- docker
script:
# maven build and run unit tests and integration tests
- mvn clean install
before_deploy:
# build deployed docker image
- docker build -t truthtree:test .
# tag docker image
- docker tag truthtree:test registry.heroku.com/truthtree/web
- docker tag truthtree:test 869798252720.dkr.ecr.us-west-2.amazonaws.com/truthtree:latest
# install heroku CLI
- wget -qO- https://toolbelt.heroku.com/install.sh | sh
# login to heroku
- echo "$HEROKU_PASSWORD" | docker login -u "$HEROKU_USERNAME" --password-stdin registry.heroku.com
# install python using conda
- >-
wget https://repo.anaconda.com/archive/Anaconda3-2018.12-Linux-x86_64.sh -O ~/anaconda3.sh
|| true
&& bash ~/anaconda3.sh -b -p ~/anaconda3 || true
&& rm ~/anaconda3.sh
&& echo 'export PATH="$HOME/anaconda3/bin:$PATH"' >> ~/.bashrc
&& source ~/.bashrc
&& conda create -n py27 python=2.7.16 -y
&& source activate py27
# install AWS CLI
- pip install --user awscli
- export PATH=$PATH:$HOME/.local/bin
# login to ECR
- eval $(aws ecr get-login --no-include-email --region us-west-2)
deploy:
# deploy develop to the staging environment
- provider: script
script:
# push to heroku
docker push registry.heroku.com/truthtree/web;
heroku container:release web --app=truthtree;
on:
branch: develop
# deploy master to production
- provider: script
script:
# push to aws
docker push $IMAGE_REPO_URL:latest;
bash ./bin/travis_wait.sh "./bin/ecs-deploy.sh -c $CLUSTER_NAME -n $SERVICE_NAME -i $IMAGE_REPO_URL:latest -r us-west-2 --timeout 1200";
on:
branch: master