-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
88 lines (79 loc) · 1.84 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
image: ccr.ccs.tencentyun.com/huzi/alpine-node:8
variables:
SSH_OPTS: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
RSYNC_OPTS: "-r --exclude=.git --delete-after --force --delay-updates"
stages:
- build
- deploy
.cache: &cache
key: "${CI_PROJECT_PATH}-${CI_COMMIT_REF_SLUG}"
paths:
- node_modules/
build:develop:
stage: build
cache:
<<: *cache
script:
- yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
- yarn config set registry https://registry.npm.taobao.org -g
- yarn install
- npm run build:develop
artifacts:
paths:
- dist/
only:
- develop
build:release:
stage: build
cache:
<<: *cache
script:
- yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
- yarn config set registry https://registry.npm.taobao.org -g
- yarn install
- npm run build:test
artifacts:
paths:
- dist/
only:
- release
build:master:
stage: build
cache:
<<: *cache
script:
- yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
- yarn config set registry https://registry.npm.taobao.org -g
- yarn install
- npm run build:master
artifacts:
paths:
- dist/
only:
- master
deploy:develop:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- rsync $RSYNC_OPTS -e "ssh $SSH_OPTS" ./dist/ ${DEVELOP_HOST}:/srv/static/red-packet/
only:
- develop
deploy:release:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- rsync $RSYNC_OPTS -e "ssh $SSH_OPTS" ./dist/ ${TEST_HOST}:/srv/static/red-packet/
only:
- release
when: manual
deploy:master:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- rsync $RSYNC_OPTS -e "ssh $SSH_OPTS" ./dist/ ${MASTER_HOST}:/srv/static/red-packet/
only:
- master
when: manual