-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
74 lines (68 loc) · 1.85 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
stages:
- install_deps
- build
- deploy
cache:
paths:
- node_modules/
- docs
# 安装依赖
install_deps:
stage: install_deps
tags:
- font-group-runner
only:
- release
- dev-branch
script:
- node -v
- yarn config set registry http://172.18.255.8:8060/repository/npm-group/
# - yarn config set registry https://registry.npm.taobao.org
- yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
- yarn install
# 编译
build_step:
stage: build
tags:
- font-group-runner
only:
- release
- dev-branch
script:
- rm ./docs/* -rf
- cd ./src/utils/api/config
- mv -f dev.js index.js
- cat index.js
- yarn build:index
# 拷贝
deploy_step:
stage: deploy
tags:
- font-group-runner
only:
- release
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $DEPLOY_SERVER >> ~/.ssh/know_hosts
- chmod 644 ~/.ssh/know_hosts
- ssh -o StrictHostKeyChecking=no -p 22 work@$DEPLOY_SERVER "cd $DEPLOY_RESOURCE_PATH; chmod +x $DEPLOY_SHELL; ./$DEPLOY_SHELL; exit"
- scp -o StrictHostKeyChecking=no -r -P 22 ./docs/* work@172.18.255.251:/disk/web/front/asset-monitor/web
# 拷贝
deploy_step_dev:
stage: deploy
tags:
- font-group-runner
only:
- dev-branch
script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan $DEPLOY_SERVER >> ~/.ssh/know_hosts
- chmod 644 ~/.ssh/know_hosts
- ssh -o StrictHostKeyChecking=no -p 22 work@$DEPLOY_SERVER "cd $DEPLOY_RESOURCE_PATH_DEV; chmod +x $DEPLOY_SHELL; ./$DEPLOY_SHELL; exit"
- scp -o StrictHostKeyChecking=no -r -P 22 ./docs/* work@172.18.255.251:/disk/web/front/asset-monitor-dev/web