-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
52 lines (46 loc) · 1.07 KB
/
.gitlab-ci.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
image: node:latest
cache:
key: node_modules
paths:
- node_modules
before_script:
- apt-get update -qq && apt-get install
- mkdir -p ~/.ssh
- echo "$DEPLOY_SERVER_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H $DEPLOYMENT_SERVER_IP >> ~/.ssh/known_hosts
stages:
- test_backend
# - test_frontend
- deploy
test_backend:
stage: test_backend
only:
- master
script:
- cd backend && yarn
- yarn test
artifacts:
paths:
- node_modules
# test_frontend:
# stage: test_frontend
# only:
# - master
# script:
# - cd frontend && yarn
# - yarn test
# artifacts:
# paths:
# - node_modules
deploy:
stage: deploy
only:
- master
script:
- ssh root@$DEPLOYMENT_SERVER_IP "cd InsanelyGood-OTOP;git pull;kill-port 3000;kill-port 8000;cd backend;yarn install;forever start -c 'yarn start' .; cd ../frontend/;yarn install;forever start -c 'yarn start' .; sleep 5;exit"
dependencies:
- test_backend
# - test_frontend