-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (41 loc) · 1.59 KB
/
.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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
dist: trusty
language: node_js
sudo: required
node_js:
- "14"
env:
- DOCKER_COMPOSE_VERSION=1.25.0
branches:
only:
- master
- develop
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- wget -qO- https://toolbelt.heroku.com/install.sh | sh
script:
- docker-compose up -d
- yarn
- yarn test
deploy:
on:
branch: master
provider: script
skip_cleanup: true
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- sudo docker build -t $DOCKER_USERNAME/animap:$TRAVIS_COMMIT .
- docker tag $DOCKER_USERNAME/animap:$TRAVIS_COMMIT $DOCKER_USERNAME/animap:latest
- docker images
- docker push $DOCKER_USERNAME/animap:$TRAVIS_COMMIT
- docker push $DOCKER_USERNAME/animap:latest
- echo "$HEROKU_API_KEY" | docker login -u "$HEROKU_USERNAME" --password-stdin registry.heroku.com
- docker tag $DOCKER_USERNAME/animap:latest registry.heroku.com/animap-backend-prod/web
- docker push registry.heroku.com/animap-backend-prod/web
- HEROKU_API_KEY=$HEROKU_API_KEY heroku container:release web --app animap-backend-prod