-
Notifications
You must be signed in to change notification settings - Fork 4
/
.gitlab-ci.yml
123 lines (114 loc) · 2.42 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#=================== Initial Configs ===============#
include:
- template: SAST.gitlab-ci.yml
- template: License-Management.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
- template: Code-Quality.gitlab-ci.yml
stages:
- build
- test
- deploy
#=================== BUILD - Package ===============#
build_package:
image: node:latest
stage: build
only:
refs:
- develop
- merge_requests
except:
refs:
- /^v.*$/
- schedules
variables:
- $SECURITY_ONLY
cache:
paths:
- node_modules/
script:
- npm install --unsafe-perm -g vsce
- npm install --unsafe-perm
- vsce package -o $CI_PROJECT_NAME-$CI_JOB_ID-$CI_PIPELINE_SOURCE.vsix --baseContentUrl $CI_PROJECT_URL/blob/$CI_COMMIT_REF_NAME
artifacts:
name: "artifacts-$CI_PROJECT_NAME-$CI_JOB_ID"
expire_in: 2 weeks
paths:
- "*.vsix"
build_package_release:
image: node:latest
stage: build
only:
refs:
- /^v.*$/
except:
refs:
- branches
- merge_requests
- schedules
variables:
- $SECURITY_ONLY
cache:
paths:
- node_modules/
script:
- npm install --unsafe-perm -g vsce
- npm install --unsafe-perm
- vsce package -o $CI_PROJECT_NAME-$CI_COMMIT_TAG.vsix --baseContentUrl $BASE_CONTENT_URL
artifacts:
name: "artifacts-$CI_PROJECT_NAME-$CI_COMMIT_TAG"
paths:
- "*.vsix"
#=================== DEPLOY - Package ==============#
deploy_package:
image: node:latest
stage: deploy
only:
refs:
- /^v.*$/
except:
refs:
- branches
- merge_requests
- schedules
variables:
- $SECURITY_ONLY
variables:
GIT_STRATEGY: none
script:
- npm install --unsafe-perm -g vsce
- vsce publish -p $VSCE_PERSONAL_ACCESS_TOKEN --packagePath $CI_PROJECT_NAME-$CI_COMMIT_TAG.vsix
#=================== TEST ==========================#
sast:
only:
refs:
- tags
- develop
- merge_requests
- schedules
license_management:
only:
refs:
- tags
- develop
- merge_requests
- schedules
variables:
NODE_ENV: production
dependency_scanning:
only:
refs:
- tags
- develop
- merge_requests
- schedules
code_quality:
only:
refs:
- tags
- develop
- merge_requests
except:
refs:
- schedules
variables:
- $SECURITY_ONLY