-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy path.cirrus.yml
229 lines (215 loc) · 7.38 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
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
#
# ENV VARIABLES
#
env:
### Shared variables
ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url]
ARTIFACTORY_PRIVATE_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader
ARTIFACTORY_PRIVATE_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
ARTIFACTORY_DEPLOY_USERNAME: vault-${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer
ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer access_token]
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
ARTIFACTORY_DEPLOY_REPO: sonarsource-public-qa
DEVELOCITY_TOKEN: VAULT[development/kv/data/develocity data.token]
DEVELOCITY_ACCESS_KEY: develocity.sonar.build=${DEVELOCITY_TOKEN}
GITHUB_TOKEN: VAULT[development/github/token/licenses-ro token]
### Project variables
DEPLOY_PULL_REQUEST: true
CIRRUS_SHELL: bash
#
# RE-USABLE CONFIGS
#
container_definition_11: &CONTAINER_DEFINITION_11
dockerfile: integrationTests/docker/Dockerfile_java11
docker_arguments:
CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT}
cluster_name: ${CIRRUS_CLUSTER_NAME}
builder_role: cirrus-builder
builder_image: docker-builder-v*
builder_instance_type: t2.small
region: eu-central-1
namespace: default
container_definition_17: &CONTAINER_DEFINITION_17
dockerfile: integrationTests/docker/Dockerfile_java17
docker_arguments:
CIRRUS_AWS_ACCOUNT: ${CIRRUS_AWS_ACCOUNT}
cluster_name: ${CIRRUS_CLUSTER_NAME}
builder_role: cirrus-builder
builder_image: docker-builder-v*
builder_instance_type: t2.small
region: eu-central-1
namespace: default
setup_gradle_cache_template: &SETUP_GRADLE_CACHE
gradle_cache:
folder: .gradle/caches
create_gradle_directory_script:
- mkdir -p "${CIRRUS_WORKING_DIR}/.gradle"
only_sonarsource_qa: &ONLY_SONARSOURCE_QA
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
log_develocity_url_script: &log_develocity_url_script |
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"
build_task:
eks_container:
<<: *CONTAINER_DEFINITION_17
cpu: 1.5
memory: 4G
env:
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
ORG_GRADLE_PROJECT_signingKey: VAULT[development/kv/data/sign data.key]
ORG_GRADLE_PROJECT_signingPassword: VAULT[development/kv/data/sign data.passphrase]
ORG_GRADLE_PROJECT_signingKeyId: VAULT[development/kv/data/sign data.key_id]
gradle_cache:
folder: ~/.gradle/caches
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script:
- *log_develocity_url_script
- source cirrus-env BUILD
- source cirrus/define-gradle.sh
- mvn -f property-dump-plugin/pom.xml -B install
- regular_gradle_build_deploy_analyze -Dsonar.gradle.skipCompile=true
on_failure:
reports_artifacts:
path: "**/build/reports/**/*"
junit_artifacts:
path: "**/test-results/**/*.xml"
format: junit
validate_external_contributor_build_task:
depends_on:
- build
eks_container:
<<: *CONTAINER_DEFINITION_17
cpu: 1.5
memory: 4G
gradle_cache:
folder: ~/.gradle/caches
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
script: |
unset ARTIFACTORY_URL && \
unset ARTIFACTORY_PRIVATE_USERNAME && \
unset ARTIFACTORY_PRIVATE_PASSWORD && \
unset ARTIFACTORY_ACCESS_TOKEN && \
./gradlew --refresh-dependencies clean assemble testClasses
on_failure:
reports_artifacts:
path: "**/build/reports/**/*"
junit_artifacts:
path: "**/test-results/**/*.xml"
format: junit
mend_scan_task:
<<: *SETUP_GRADLE_CACHE
depends_on:
- build
# run only on master and long-living branches
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "mend-.*")
eks_container:
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j21-latest
region: eu-central-1
cluster_name: ${CIRRUS_CLUSTER_NAME}
namespace: default
cpu: 4
memory: 2G
env:
WS_APIKEY: VAULT[development/kv/data/mend data.apikey]
maven_cache:
folder: ${CIRRUS_WORKING_DIR}/.m2/repository
mend_script:
- source cirrus-env QA
- ./gradlew clean build -x test
- source ./export_ws_variables.sh
- source ws_scan.sh
allow_failures: "true"
always:
ws_scan_artifacts:
path: "whitesource/**/*"
gradle_qa_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
eks_container:
<<: *CONTAINER_DEFINITION_17
cpu: 2
memory: 4G
env:
matrix:
- GRADLE_VERSION: 8.4
ANDROID_GRADLE_VERSION: 8.3.0
- GRADLE_VERSION: 8.10
- GRADLE_VERSION: 8.4
- GRADLE_VERSION: 8.3
- GRADLE_VERSION: 8.0
- GRADLE_VERSION: 7.6.4
- GRADLE_VERSION: 7.5.1
ANDROID_GRADLE_VERSION: 7.1.0
script:
- *log_develocity_url_script
- ./cirrus/cirrus-qa.sh
gradle_qa_java11_task:
depends_on:
- build
<<: *ONLY_SONARSOURCE_QA
eks_container:
<<: *CONTAINER_DEFINITION_11
cpu: 2
memory: 2G
env:
matrix:
- GRADLE_VERSION: 7.5.1
ANDROID_GRADLE_VERSION: 7.1.0
- GRADLE_VERSION: 6.8.3
ANDROID_GRADLE_VERSION: 4.2.0
- GRADLE_VERSION: 5.6.4
ANDROID_GRADLE_VERSION: 3.5.4
script:
- *log_develocity_url_script
- ./cirrus/cirrus-qa.sh
promote_task:
depends_on:
- build
- validate_external_contributor_build
- gradle_qa
- gradle_qa_java11
<<: *ONLY_SONARSOURCE_QA
eks_container:
<<: *CONTAINER_DEFINITION_17
cpu: 1
memory: 2G
env:
ARTIFACTORY_PROMOTE_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promotion token]
script: cirrus_promote_gradle
release_to_plugin_portal_task:
only_if: $CIRRUS_PRERELEASE != "true" && $CIRRUS_RELEASE != ""
stateful: 'true'
depends_on:
- promote
eks_container:
<<: *CONTAINER_DEFINITION_17
cpu: 1.5
memory: 4G
gradle_cache:
folder: ~/.gradle/caches
env:
ORG_GRADLE_PROJECT_signingKey: VAULT[development/kv/data/sign data.key]
ORG_GRADLE_PROJECT_signingPassword: VAULT[development/kv/data/sign data.passphrase]
ORG_GRADLE_PROJECT_signingKeyId: VAULT[development/kv/data/sign data.key_id]
GRADLE_PUBLISH_KEY: VAULT[development/kv/data/gradle/publish data.key]
GRADLE_PUBLISH_SECRET: VAULT[development/kv/data/gradle/publish data.secret]
ARTIFACTORY_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-promoter access_token]
script: |
source cirrus-env RELEASE
./gradlew \
--info \
--stacktrace \
--console plain \
"-Pgradle.publish.key=${GRADLE_PUBLISH_KEY}" \
"-Pgradle.publish.secret=${GRADLE_PUBLISH_SECRET}" \
"-DbuildNumber=${BUILD_NUMBER}" \
publishPlugins
jfrog rt bpr \
--url "${ARTIFACTORY_URL}" \
--access-token "${ARTIFACTORY_ACCESS_TOKEN}" \
--status released \
"${CIRRUS_REPO_NAME}" "${BUILD_NUMBER}" sonarsource-public-releases