-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
76 lines (65 loc) Β· 2.43 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
67
68
69
70
71
72
73
74
75
76
language: node_js
node_js:
- 10
sudo: required
cache: npm
services:
- docker
branches:
only:
- feature/travis
- master
- develop
jobs:
include:
- stage: "TEST"
if: type = pull_request
name: "Front-end test"
before_install:
- cd ./client
install:
- npm install
script:
- npm test
- name: "Back-end test"
if: type = pull_request
before_install:
- cd ./server
install:
- npm install
script:
- npm test
- stage: "BUILD"
name: "Front-end build"
if: type = push
before_script:
- cd ./client
- echo "$NCP_SECRET_KEY" | docker login -u "$NCP_ACCESS_KEY_ID" dev-2019-01.kr.ncr.ntruss.com --password-stdin
script:
- docker build --build-arg REACT_APP_LOCAL_CLIENT_ID --build-arg REACT_APP_PRODUCTION_CLIENT_ID --build-arg REACT_APP_JWT_SECRET_KEY --build-arg REACT_APP_JWT_ALGORITHM -t dev-2019-01.kr.ncr.ntruss.com/front-end . -f ../docker/client.Dockerfile
after_success:
- docker push dev-2019-01.kr.ncr.ntruss.com/front-end
- name: "Back-end build"
if: type = push
before_script:
- cd ./server
- echo "$NCP_SECRET_KEY" | docker login -u "$NCP_ACCESS_KEY_ID" dev-2019-01.kr.ncr.ntruss.com --password-stdin
script:
- docker build -t dev-2019-01.kr.ncr.ntruss.com/back-end . -f ../docker/server.Dockerfile
after_success:
- docker push dev-2019-01.kr.ncr.ntruss.com/back-end
- name: "Mysql build"
if: type = push
before_script:
- cd ./mysql
- echo "$NCP_SECRET_KEY" | docker login -u "$NCP_ACCESS_KEY_ID" dev-2019-01.kr.ncr.ntruss.com --password-stdin
script:
- docker build -t dev-2019-01.kr.ncr.ntruss.com/mysql . -f ../docker/mysql.Dockerfile
after_success:
- docker push dev-2019-01.kr.ncr.ntruss.com/mysql
- stage: "DEPLOY"
name: "Dev-server deploy"
if: (type = push) AND ((branch = develop) OR (branch = feature/travis))
script:
- sudo apt-get install sshpass
- sshpass -p "$DEV_SERVER_SSH_PW" ssh -p 2222 -o StrictHostKeyChecking=no root@"$DEV_SERVER_IP" ./deploy.sh