forked from fga-eps-mds/2019.2-Gymnasteg-Backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (53 loc) · 1.5 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
sudo: required
language:
- node_js
- python
node_js:
- '10.16.3'
python:
- '3.6'
services:
- docker
stages:
- Tests
- Deploy docker image stage
- Deploy docker image prod
- Upgrade rancher service
before_install:
- yarn install
- pip install requests
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# install:
# - docker network create network-api
# - docker-compose up --build -d
jobs:
include:
# - stage: "Tests"
# name: "Tests"
# script:
# # run lint and tests
# - yarn run test -u --coverage
# - ./node_modules/.bin/codecov -t ${CODECOV_API_TOKEN}
- stage: 'Deploy docker image stage'
name: 'Deploy docker image stage'
if: branch = devel
script:
# build docker image
- docker build -t gymnasteg2019/backend:homolog .
# push image to Docker Hub
- docker push gymnasteg2019/backend:homolog
- stage: 'Deploy docker image prod'
name: 'Deploy docker image prod'
if: branch = master
script:
# build docker image
- docker build -t gymnasteg2019/backend:prod .
# push image to Docker Hub
- docker push gymnasteg2019/backend:prod
- stage: 'Upgrade rancher service'
name: 'Upgrade rancher service'
if: (NOT type IN (pull_request)) AND (branch = master || branch = devel)
script: python ./scripts/upgrade_service.py
after_script:
# - docker-compose down
- yarn posttest