-
Notifications
You must be signed in to change notification settings - Fork 2
/
shippable.yml
52 lines (43 loc) · 1.91 KB
/
shippable.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
language: node_js
node_js:
- 12.14.0
branches:
only:
- master
env:
global:
- secure: zqajz+HhInQjuUPSdMB+WS2vtDQAp7PPdi23+warFD9t9WY3ZE9pUaAfgIvBNM1jSV0H3HglzkaabWXMUADo6J8kzOrrXfi75sis88sknul6ltmY0OsJNMFrA0YvRWIBDqVPSzjuieUrTu1Rf7uAinFyjCZpI11WRDkNolDQyHwe25rEP8cif5sh2Q9DGYhlV3UmtqroOvYmlVASH34q5dGn95DU2OFEGW47J/RWTxloHiGLM5RqxGqiHBX4djIP0dKRZm9yHOd5sjlbZpQFgyMRazWAVcCwcmxXyYfvVj0u0W0qI2oJVtR0NkNcGePBaGmCVWoLa+cPzsvPsqy1Eg==
- DOCKER_ACC=quay.io/kinotimes
- CI=true
- REACT_APP_KT_BACKEND_PORT=8888
- REACT_APP_KT_PORT=3000
- REACT_APP_KT_URL=http://kinotimes.tk
build:
cache: true
cache_dir_list:
- $SHIPPABLE_BUILD_DIR/backend/node_modules
- $SHIPPABLE_BUILD_DIR/frontend/node_modules
ci:
- npm install -g create-react-app
- npm install -g yarn
# build backend
- shippable_retry cd $SHIPPABLE_BUILD_DIR/backend/; npm install
# build frontend
- shippable_retry cd $SHIPPABLE_BUILD_DIR/frontend/; yarn
- cd $SHIPPABLE_BUILD_DIR/frontend/; npm test
- shippable_retry cd $SHIPPABLE_BUILD_DIR/frontend/; yarn build
# build docker images
- docker build -f $SHIPPABLE_BUILD_DIR/frontend/Dockerfile.web -t $DOCKER_ACC/web:$BUILD_NUMBER $SHIPPABLE_BUILD_DIR/frontend/
- docker build -f $SHIPPABLE_BUILD_DIR/backend/Dockerfile.backend -t $DOCKER_ACC/backend:$BUILD_NUMBER --build-arg tmdb_token=$TMDB_TOKEN --build-arg omdb_apikey=$OMDB_APIKEY $SHIPPABLE_BUILD_DIR/backend/
post_ci:
- if [ "$IS_PULL_REQUEST" != true ]; then docker push $DOCKER_ACC/web:$BUILD_NUMBER; fi
- if [ "$IS_PULL_REQUEST" != true ]; then docker push $DOCKER_ACC/backend:$BUILD_NUMBER; fi
on_success:
- if [ "$IS_PULL_REQUEST" != true ]; then ssh root@$SERVER_IP "cd /root/app; export BUILD=$BUILD_NUMBER && docker-compose up -d"; fi
integrations:
hub:
- integrationName: quay-integration
type: quay.io
key:
- integrationName: vm
type: sshKey