This repository has been archived by the owner on Jun 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
92 lines (84 loc) · 2.66 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
89
90
91
92
image: node:12.14.0
stages:
- build
- upload
- sonarqube-check
before_script:
- mkdir -p ~/.ssh
- touch ~/.ssh/id_rsa
- touch ~/.ssh/config
- chmod 700 ~/.ssh/id_rsa
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- echo "$SSH_CONFIG" > ~/.ssh/config
build:lib:
stage: build
rules:
- if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_TAG =~ "/^$/"'
when: manual
- if: '$CI_COMMIT_REF_NAME == "master" && $CI_COMMIT_TAG =~ "/^$/"'
when: manual
cache:
untracked: true
key: ${CI_COMMIT_REF_SLUG}
paths:
- packages/angular-components/dist/ng-ui-components/bundles
- packages/native-js/lib
- packages/react-components/lib
- packages/vue-components/lib
script:
- yarn
- yarn run build:lib
artifacts:
untracked: false
paths:
- packages/angular-components/dist/ng-ui-components/bundles
- packages/native-js/lib
- packages/react-components/lib
- packages/vue-components/lib
expire_in: 30 days
upload:oss:
stage: upload
# when: manual
image:
name: fuergaosi/ossutil:latest
script:
- export VERSION=$(cat lerna.json | grep version | head -1 | awk -F= "{ print $2 }" | sed 's/[version:,\",]//g' | tr -d '[[:space:]]')
- echo 上传包到 cdn
- echo $CDN_OSS_PROD
- echo $OSS_REGION_PROD
- echo 版本 $VERSION
- >
ossutil --access-key-id ${ALIYUN_ACCESS_KEY}
--access-key-secret ${ALIYUN_ACCESS_KEY_SECRET}
-e ${OSS_REGION_PROD} cp -r -f packages/angular-components/dist/ng-ui-components/bundles oss://${CDN_OSS_PROD}/packages/ng-ui-components/${VERSION}/
- >
ossutil --access-key-id ${ALIYUN_ACCESS_KEY}
--access-key-secret ${ALIYUN_ACCESS_KEY_SECRET}
-e ${OSS_REGION_PROD} cp -r -f packages/native-js/lib oss://${CDN_OSS_PROD}/packages/native-js-ui-components/${VERSION}/
- >
ossutil --access-key-id ${ALIYUN_ACCESS_KEY}
--access-key-secret ${ALIYUN_ACCESS_KEY_SECRET}
-e ${OSS_REGION_PROD} cp -r -f packages/react-components/lib oss://${CDN_OSS_PROD}/packages/react-ui-components/${VERSION}/
- >
ossutil --access-key-id ${ALIYUN_ACCESS_KEY}
--access-key-secret ${ALIYUN_ACCESS_KEY_SECRET}
-e ${OSS_REGION_PROD} cp -r -f packages/vue-components/lib oss://${CDN_OSS_PROD}/packages/vue-ui-components/${VERSION}/
dependencies:
- build:lib
sonarqube-check:
stage: sonarqube-check
image:
name: sonarsource/sonar-scanner-cli:latest
entrypoint: ['']
variables:
SONAR_USER_HOME: '${CI_PROJECT_DIR}/.sonar'
GIT_DEPTH: '0'
cache:
key: '${CI_JOB_NAME}'
paths:
- .sonar/cache
script:
- sonar-scanner
allow_failure: true
only:
- master