-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
68 lines (60 loc) · 3.18 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
variables:
NPM_REGISTRY: "npm.hfjy.red:4873"
NPM_AUTH_TOKEN: "NEp/wBNA7U3ZIvmic9+phQ=="
before_script:
- CASE_PATH="$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/${CI_BUILD_TAG:-$CI_BUILD_REF_NAME}"
- echo $CASE_PATH
stages:
- deploy
- alertify
deploy-branches:
stage: deploy
only:
- branches
variables:
PUB_TO: "[email protected]:/opt/case/web"
script:
- echo -e "//$NPM_REGISTRY/:_authToken=\"$NPM_AUTH_TOKEN\"\nregistry=http://$NPM_REGISTRY" > ~/.npmrc
- mkdir -p /tmp/runner_caches/$CASE_PATH/node_modules
- cp -f -r /tmp/runner_caches/$CASE_PATH/node_modules ./
- npm install --registry=http://$NPM_REGISTRY --sass-binary-site=https://npm.taobao.org/mirrors/node-sass
- cp -f -r ./node_modules /tmp/runner_caches/$CASE_PATH/
- npm run test-units
# - ./node_modules/.bin/webpack
# - echo "$CI_BUILD_TAG" > ./dist/VERSION.txt
- mkdir -p "_tmpdir/$CASE_PATH"
- rsync -avur -e 'ssh -o StrictHostKeyChecking=no' _tmpdir/ $PUB_TO/
- echo "推送到开发节点 $PUB_TO/$CASE_PATH/"
- rsync -avur -e 'ssh -o StrictHostKeyChecking=no' --delete docs_lib/html/ $PUB_TO/$CASE_PATH/
- rsync -avur -e 'ssh -o StrictHostKeyChecking=no' --delete .sdocs-dist/ $PUB_TO/$CASE_PATH/vui
- rsync -avur -e 'ssh -o StrictHostKeyChecking=no' --delete packages/.sdocs-dist/ $PUB_TO/$CASE_PATH/vpackages
# - echo "推送到dev $PUB_TO/$CASE_PATH/"
# - rsync -avurz --delete -e 'ssh -o StrictHostKeyChecking=no -i /home/gitlab-runner/.ssh/spub_key' dist/ [email protected]:/opt/case/test-preschool/
# - echo "推送到test [email protected]:/opt/case/www/wwwroot/vui-core"
# - rsync -avurz --delete -e 'ssh -o StrictHostKeyChecking=no -i /home/gitlab-runner/.ssh/spub_key -p 16300' dist/ [email protected]:/opt/case/www/webroot/vui-core
deploy-tags:
stage: deploy
only:
- tags
- triggers
variables:
PUB_TO: "[email protected]:/opt/case/web"
script:
- echo -e "//$NPM_REGISTRY/:_authToken=\"$NPM_AUTH_TOKEN\"\nregistry=http://$NPM_REGISTRY" > ~/.npmrc
- mkdir -p /tmp/runner_caches/$CASE_PATH/node_modules
- cp -f -r /tmp/runner_caches/$CASE_PATH/node_modules ./
- npm install --registry=http://$NPM_REGISTRY --sass-binary-site=https://npm.taobao.org/mirrors/node-sass >> /tmp/npm-install.log
- cp -f -r ./node_modules /tmp/runner_caches/$CASE_PATH/
- npm run test-units
- echo "$CI_BUILD_TAG" > ./dist/VERSION.txt
# - echo "推送到开发节点 $PUB_TO/$CASE_PATH/"
# - rsync -avur -e 'ssh -o StrictHostKeyChecking=no' --delete dist/ $PUB_TO/$CASE_PATH/
#
# - echo "推送到dev $PUB_TO/$CASE_PATH/"
# - rsync -avurz --delete -e 'ssh -o StrictHostKeyChecking=no -i /home/gitlab-runner/.ssh/spub_key' dist/ [email protected]:/opt/case/test-preschool/
#
# - echo "推送到i-test [email protected]:/opt/case/test-preschool/"
# - rsync -avurz --delete -e 'ssh -o StrictHostKeyChecking=no -i /home/gitlab-runner/.ssh/spub_key -p 16300' dist/ [email protected]:/opt/case/test-preschool/
#
# - echo "推送到S3 [email protected]:/opt/case/test-preschool/"
# - rsync -avurz --delete -e 'ssh -o StrictHostKeyChecking=no -i /home/gitlab-runner/.ssh/spub_key -p 16300' dist/ [email protected]:/opt/case/test-preschool/