forked from SonarSource/sonar-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
167 lines (156 loc) · 5.89 KB
/
.cirrus.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
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
gcp_credentials: ENCRYPTED[!17c59813193e86cc337bce848b358412b90f50bc5fe1b8b39d363cdf14a41ebe76cfba0482e7f81d076994b9f6dbfb4c!]
env:
ARTIFACTORY_URL: ENCRYPTED[!2f8fa307d3289faa0aa6791f18b961627ae44f1ef46b136e1a1e63b0b4c86454dbb25520d49b339e2d50a1e1e5f95c88!]
ARTIFACTORY_PRIVATE_USERNAME: private-reader
ARTIFACTORY_PRIVATE_PASSWORD: ENCRYPTED[!921e2792ce1fc164aaea1146ab2478e7aefd8aaa87022ca745adccee4deaa470bb883ad3066738fceb37622f239296a7!]
ARTIFACTORY_DEPLOY_USERNAME: public-qa-deployer
ARTIFACTORY_DEPLOY_PASSWORD: ENCRYPTED[!ee8f6410a42b81c6c91c7b760e7be7796a7774b6e6e6acf3ff2ecf8c7c04c732865a0300673ea41155c0d19a989c0a5a!]
#Possible values for ARTIFACTORY_DEPLOY_REPO: sonarsource-private-qa, sonarsource-public-qa
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
ARTIFACTORY_API_KEY: ENCRYPTED[!f9526e763214dcd6f0cac5fbf712664bcf05395cc5c8f9f122ccf3a4c6d42c2bc809bff8a6d9904c935a47a05676682c!]
# burgr notification
BURGR_URL: ENCRYPTED[!c7e294da94762d7bac144abef6310c5db300c95979daed4454ca977776bfd5edeb557e1237e3aa8ed722336243af2d78!]
BURGR_USERNAME: ENCRYPTED[!b29ddc7610116de511e74bec9a93ad9b8a20ac217a0852e94a96d0066e6e822b95e7bc1fe152afb707f16b70605fddd3!]
BURGR_PASSWORD: ENCRYPTED[!83e130718e92b8c9de7c5226355f730e55fb46e45869149a9223e724bb99656878ef9684c5f8cfef434aa716e87f4cf2!]
GITHUB_TOKEN: ENCRYPTED[!f272985ea5b49b3cf9c414b98de6a8e9096be47bfcee52f33311ba3131a2af637c1b956f49585b7757dd84b7c030233a!]
# Use bash (instead of sh on linux or cmd.exe on windows)
CIRRUS_SHELL: bash
# Allows to run builds for the 50 last commits in a branch:
CIRRUS_CLONE_DEPTH: 50
container_definition: &CONTAINER_DEFINITION
image: gcr.io/language-team/base:latest
cluster_name: cirrus-ci-lt-cluster
zone: us-central1-a
namespace: default
win_vm_definition: &WINDOWS_VM_DEFINITION
gce_instance:
image_project: language-team
image_family: lt-base-windows
platform: windows
zone: us-central1-a
preemptible: false
disk: 128
type: n1-standard-4
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:
<<: *CONTAINER_DEFINITION
cpu: 2
memory: 2G
env:
# analysis on next
SONAR_TOKEN: ENCRYPTED[!5ba7cbb5bf9d168de69bcd444d9e884c9cf664be1115640cc64e49df6d241c309a87fc527cab533c08f289b167187017!]
SONAR_HOST_URL: https://next.sonarqube.com/sonarqube
#allow deployment of pull request artifacts to repox
DEPLOY_PULL_REQUEST: true
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
build_script:
- source cirrus-env BUILD
- regular_mvn_build_deploy_analyze
- ./check-license-compliance.sh
cleanup_before_cache_script: cleanup_maven_repository
qa_os_win_task:
depends_on:
- build
<<: *WINDOWS_VM_DEFINITION
maven_cache:
#folder is specified in order to prevent cache miss on windows
folder: ~/.m2/repository
build_script:
- source cirrus-env CI
- mvn.cmd clean verify
cleanup_before_cache_script: cleanup_maven_repository
plugin_qa_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
<<: *CONTAINER_DEFINITION
cpu: 3
memory: 8G
env:
matrix:
- SQ_VERSION: LATEST_RELEASE[7.9]
- SQ_VERSION: LATEST_RELEASE
- SQ_VERSION: DOGFOOD
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
submodules_script:
- git submodule update --init
qa_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- cd its/plugin
- mvn package -Pit-plugin -Dsonar.runtimeVersion=${SQ_VERSION} -Dmaven.test.redirectTestOutputToFile=false -B -e -V
cleanup_before_cache_script: cleanup_maven_repository
sanity_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
<<: *CONTAINER_DEFINITION
cpu: 4
memory: 8G
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
sanity_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- mvn clean verify -Psanity
cleanup_before_cache_script: cleanup_maven_repository
ruling_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
gke_container:
<<: *CONTAINER_DEFINITION
cpu: 4
memory: 8G
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 package -Pit-ruling -Dsonar.runtimeVersion=LATEST_RELEASE[7.9] -Dmaven.test.redirectTestOutputToFile=false -B -e -V
cleanup_before_cache_script: cleanup_maven_repository
ruling_win_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
<<: *WINDOWS_VM_DEFINITION
maven_cache:
folder: ~/.m2/repository
ruling_script:
- source cirrus-env QA
- source set_maven_build_version $BUILD_NUMBER
- init_git_submodules its/sources
- cd its/ruling
- mvn package -Pit-ruling -Dsonar.runtimeVersion=LATEST_RELEASE[7.9] -Dmaven.test.redirectTestOutputToFile=false -B -e -V
cleanup_before_cache_script: cleanup_maven_repository
promote_task:
depends_on:
- qa_os_win
- sanity
- ruling
- ruling_win
- plugin_qa
<<: *ONLY_SONARSOURCE_QA
gke_container:
<<: *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.java:sonar-java-plugin:jar
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script: cirrus_promote_maven
cleanup_before_cache_script: cleanup_maven_repository