-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
66 lines (60 loc) · 1.24 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
stages:
- install
- lint
- build
- deploy
cache:
key: ${CI_BUILD_REF_NAME}
paths:
- node_modules/
- packages/**/dist/
before_script:
- export PATH=$PATH:$PWD/node_modules/.bin:$PWD/packages/badanmu/node_modules/.bin
install:
stage: install
only:
refs:
- merge_requests
- /^release-v\d(\d|\d\.\d)*$/i
- tags
tags:
- linux-runner
script:
- yarn install
build:
stage: build
only:
refs:
- merge_requests
- /^release-v\d(\d|\d\.\d)*$/i
- tags
tags:
- linux-runner
script:
- yarn workspace badanmu build
lint:
stage: lint
only:
refs:
- merge_requests
- /^release-v\d(\d|\d\.\d)*$/i
- tags
tags:
- linux-runner
script:
- yarn workspace badanmu lint --quiet
deploy:
stage: deploy
when: manual
only:
refs:
- merge_requests
- /^release-v\d(\d|\d\.\d)*$/i
- tags
tags:
- linux-runner
script:
# 同步文件
- rsync --delete -av --exclude="node_modules" --exclude="logs" --exclude="*.log" --exclude=".DS_Store" ./packages/badanmu/ [email protected]:/cygdrive/c/webserver/badanmu
# 依次部署所有服务
- ssh [email protected] 'cd /cygdrive/c/webserver/badanmu/ && sh ./deploy.sh'