forked from SonarSource/SonarJS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.cirrus.yml
More file actions
232 lines (216 loc) · 8.14 KB
/
.cirrus.yml
File metadata and controls
232 lines (216 loc) · 8.14 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
gcp_credentials: ENCRYPTED[!149d4005ecdba4cdd78bb5ba22756ebb98bf8e3367ee2e9ab08c5a1608c0d3e3b501904b67a1d67c0b63085e469d7dde!]
env:
ARTIFACTORY_URL: ENCRYPTED[!2f8fa307d3289faa0aa6791f18b961627ae44f1ef46b136e1a1e63b0b4c86454dbb25520d49b339e2d50a1e1e5f95c88!]
ARTIFACTORY_PRIVATE_USERNAME: repox-private-reader-lt-ef42e7
ARTIFACTORY_PRIVATE_PASSWORD: ENCRYPTED[!9b954ad23535be51e04d7ad72d8f79b93141341f3b6fe5527140e1ffa9570694f23ddea6fc384b742e7ec956533765d6!]
ARTIFACTORY_DEPLOY_USERNAME: repox-qa-deployer-lt-ef42e7
ARTIFACTORY_DEPLOY_PASSWORD: ENCRYPTED[!e9d67cbbb9ffaa6a05b863eae9d08292b431481ae920205c7cb42d8811c18a932f2a29f486a46171c9ac6c053bc51e73!]
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
ARTIFACTORY_API_KEY: ENCRYPTED[!9b954ad23535be51e04d7ad72d8f79b93141341f3b6fe5527140e1ffa9570694f23ddea6fc384b742e7ec956533765d6!]
# burgr notification
BURGR_URL: ENCRYPTED[!c7e294da94762d7bac144abef6310c5db300c95979daed4454ca977776bfd5edeb557e1237e3aa8ed722336243af2d78!]
BURGR_USERNAME: ENCRYPTED[!b29ddc7610116de511e74bec9a93ad9b8a20ac217a0852e94a96d0066e6e822b95e7bc1fe152afb707f16b70605fddd3!]
BURGR_PASSWORD: ENCRYPTED[!83e130718e92b8c9de7c5226355f730e55fb46e45869149a9223e724bb99656878ef9684c5f8cfef434aa716e87f4cf2!]
# Use bash (instead of sh on linux or cmd.exe on windows)
CIRRUS_SHELL: bash
container_definition: &CONTAINER_DEFINITION
builder_image_project: release-engineering-ci-prod
builder_image_name: family/docker-builder
cluster_name: cirrus-ci
zone: europe-west4-b
namespace: default
use_in_memory_disk: true
win_vm_definition: &WINDOWS_VM_DEFINITION
gce_instance:
image_project: release-engineering-ci-prod
image_family: lt-base-windows-jdk11
platform: windows
zone: europe-west4-b
preemptible: false
disk: 128
type: c2-standard-8
use_ssd: true
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
build_task:
gke_container:
dockerfile: .cirrus/nodejs-12.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 15
memory: 24G
env:
GITHUB_TOKEN: ENCRYPTED[!f458126aa9ed2ac526f220c5acb51dd9cc255726b34761a56fc78d4294c11089502a882888cef0ca7dd4085e72e611a5!]
# analysis on next
SONAR_TOKEN: ENCRYPTED[!b6fd814826c51e64ee61b0b6f3ae621551f6413383f7170f73580e2e141ac78c4b134b506f6288c74faa0dd564c05a29!]
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
#allow deployment of pull request artifacts to repox
DEPLOY_PULL_REQUEST: true
#sign artifacts
SIGN_KEY: ENCRYPTED[!cc216dfe592f79db8006f2a591f8f98b40aa2b078e92025623594976fd32f6864c1e6b6ba74b50647f608e2418e6c336!]
PGP_PASSPHRASE: ENCRYPTED[!314a8fc344f45e462dd5e8dccd741d7562283a825e78ebca27d4ae9db8e65ce618e7f6aece386b2782a5abe5171467bd!]
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
sonar_cache:
folder: ${HOME}/.sonar/cache
fingerprint_script:
- echo ${CIRRUS_OS}
- curl --silent ${SONAR_HOST_URL}/deploy/plugins/index.txt | sort
build_script:
- source cirrus-env BUILD
- npm config set registry "${ARTIFACTORY_URL}/api/npm/npm"
- regular_mvn_build_deploy_analyze
cleanup_before_cache_script: cleanup_maven_repository
build_win_task:
depends_on:
- build
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
maven_cache:
#windows cache is buggy if using ${CIRRUS_WORKING_DIR}
folder: ~/.m2/repository
build_script:
- source cirrus-env CI
- npm config set registry "${ARTIFACTORY_URL}/api/npm/npm"
- mvn test
cleanup_before_cache_script: cleanup_maven_repository
ws_scan_task:
depends_on:
- build
gke_container:
dockerfile: .cirrus/nodejs-12.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 4
memory: 8G
# run only on master and long-term branches
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*")
env:
WS_APIKEY: ENCRYPTED[!3929c6148b9dfc751a2d17c590b15d755f82cd9c108f2de5f24a5b32f2a0c26144e921fab7e2c959fc2824d6d6d1550d!]
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
whitesource_script:
- source cirrus-env QA
- npm config set registry "${ARTIFACTORY_URL}/api/npm/npm"
- source set_maven_build_version $BUILD_NUMBER
- mvn clean install -DskipTests
- source ws_scan.sh
allow_failures: "true"
always:
ws_artifacts:
path: "whitesource/**/*"
plugin_qa_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
dockerfile: .cirrus/nodejs-12.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 3
memory: 8G
env:
CIRRUS_CLONE_DEPTH: 10
SONARSOURCE_QA: true
matrix:
- SQ_VERSION: LATEST_RELEASE[8.9]
- SQ_VERSION: LATEST_RELEASE
- SQ_VERSION: DEV
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
qa_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- mvn -f its/plugin/pom.xml -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V verify
cleanup_before_cache_script: cleanup_maven_repository
plugin_qa_nodejs_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
matrix:
- dockerfile: .cirrus/nodejs-12.Dockerfile
- dockerfile: .cirrus/nodejs-14.Dockerfile
- dockerfile: .cirrus/nodejs-16.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 3
memory: 8G
env:
CIRRUS_CLONE_DEPTH: 10
SONARSOURCE_QA: true
SQ_VERSION: LATEST_RELEASE
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
qa_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- mvn -f its/plugin/pom.xml -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V verify
cleanup_before_cache_script: cleanup_maven_repository
plugin_qa_win_task:
depends_on:
- build
<<: *WINDOWS_VM_DEFINITION
<<: *ONLY_SONARSOURCE_QA
env:
SONARSOURCE_QA: true
SQ_VERSION: LATEST_RELEASE
maven_cache:
#windows cache is buggy if using ${CIRRUS_WORKING_DIR}
folder: ~/.m2/repository
qa_script:
- source /c/buildTools-docker/bin/cirrus-env QA
- source /c/buildTools-docker/bin/set_maven_build_version $BUILD_NUMBER
- mvn -f its/plugin/pom.xml -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V verify
cleanup_before_cache_script: cleanup_maven_repository
ruling_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
matrix:
- dockerfile: .cirrus/nodejs-12.Dockerfile
- dockerfile: .cirrus/nodejs-14.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 4
memory: 12G
env:
CIRRUS_CLONE_DEPTH: 10
SONARSOURCE_QA: true
matrix:
- RULING: JavaScriptRulingTest
- RULING: TypeScriptRulingTest
- RULING: CssRulingTest
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
submodules_script:
- git submodule update --init
ruling_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd its/ruling
- mvn verify -Dtest=${RULING} -Dsonar.runtimeVersion=LATEST_RELEASE -Dmaven.test.redirectTestOutputToFile=false -B -e -V
cleanup_before_cache_script: cleanup_maven_repository
on_failure:
diff_artifacts:
path: "**/target/actual/**/*"
promote_task:
depends_on:
- ws_scan
- build_win
- plugin_qa
- plugin_qa_win
- plugin_qa_nodejs
- ruling
<<: *ONLY_SONARSOURCE_QA
gke_container:
dockerfile: .cirrus/nodejs-12.Dockerfile
<<: *CONTAINER_DEFINITION
cpu: 1
memory: 1G
env:
#promotion cloud function
GCF_ACCESS_TOKEN: ENCRYPTED[!1fb91961a5c01e06e38834e55755231d649dc62eca354593105af9f9d643d701ae4539ab6a8021278b8d9348ae2ce8be!]
PROMOTE_URL: ENCRYPTED[!e22ed2e34a8f7a1aea5cff653585429bbd3d5151e7201022140218f9c5d620069ec2388f14f83971e3fd726215bc0f5e!]
#artifacts that will have downloadable links in burgr
ARTIFACTS: org.sonarsource.javascript:sonar-javascript-plugin:jar
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script: cirrus_promote_maven
cleanup_before_cache_script: cleanup_maven_repository