-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cirrus.yml
147 lines (136 loc) · 5.25 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
env:
CIRRUS_CLONE_DEPTH: "20"
CIRRUS_SHELL: bash
# Artifactory settings
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_ACCESS_TOKEN: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-private-reader access_token]
ARTIFACTORY_DEPLOY_USERNAME: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer username]
ARTIFACTORY_DEPLOY_PASSWORD: VAULT[development/artifactory/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-qa-deployer 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}
DEPLOY_PULL_REQUEST: "true"
# Gradle settings
GRADLE_USER_HOME: ${CIRRUS_WORKING_DIR}/.gradle
eks_container: &CONTAINER_DEFINITION
image: ${CIRRUS_AWS_ACCOUNT}.dkr.ecr.eu-central-1.amazonaws.com/base:j17-g7-latest
cluster_name: ${CIRRUS_CLUSTER_NAME}
region: eu-central-1
namespace: default
setup_gradle_cache_template: &SETUP_GRADLE_CACHE
gradle_cache:
folder: .gradle/caches
fingerprint_script:
- echo $CIRRUS_OS
- cat **/*.gradle* **/gradle*.properties || true
create_gradle_directory_script:
- mkdir -p "${CIRRUS_WORKING_DIR}/.gradle"
log_develocity_url_script: &log_develocity_url_script |
echo "Develocity URL: https://develocity.sonar.build/scans?search.publicHostnames=cirrus-ci-task-${CIRRUS_TASK_ID}"
only_if_sonarsource_qa_template: &ONLY_IF_SONARSOURCE_QA
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_TAG == "" && ($CIRRUS_PR != "" || $CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "dogfood-on-.*")
qa_task_filter_template: &QA_TASK_FILTER
depends_on:
- build
<<: *ONLY_IF_SONARSOURCE_QA
build_task:
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 8
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]
<<: *SETUP_GRADLE_CACHE
build_script:
- *log_develocity_url_script
- source cirrus-env BUILD
- function gradle(){ ./gradlew "$@"; }; export -f gradle
- gradle --version
- source set_gradle_build_version
- regular_gradle_build_deploy_analyze
on_failure:
error_log_artifacts:
path: "hs_err_pid*.log"
heap_dump_artifacts:
path: "*.hprof"
mend_task:
depends_on:
- build
only_if: $CIRRUS_USER_COLLABORATOR == 'true' && ($CIRRUS_BRANCH == "master" || $CIRRUS_BRANCH =~ "branch-.*" || $CIRRUS_BRANCH =~ "mend-.*")
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 8
memory: 4G
env:
WS_APIKEY: VAULT[development/kv/data/mend data.apikey]
<<: SETUP_GRADLE_CACHE
scan_script:
- *log_develocity_url_script
- source cirrus-env QA
- ./gradlew clean build --exclude-task test
- source export_ws_variables_from_gradle
- source ws_scan.sh
allow_failures: "true"
always:
ws_artifacts:
path: "whitesource/**/*"
qa_plugin_task:
<<: *QA_TASK_FILTER
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 8
memory: 8G
env:
matrix:
- SQ_VERSION: "LATEST_RELEASE"
- SQ_VERSION: "DEV"
<<: *SETUP_GRADLE_CACHE
plugin_script:
- *log_develocity_url_script
- source cirrus-env QA
- ./gradlew ":its:plugin:test" --project-prop plugin
"-Dsonar.runtimeVersion=${SQ_VERSION}"
"-Dorchestrator.artifactory.accessToken=${ARTIFACTORY_ACCESS_TOKEN}"
"-DbuildNumber=$BUILD_NUMBER"
-I "${GRADLE_HOME}/init.d/repoxAuth.init.gradle.kts"
--info --stacktrace --console plain --no-daemon --build-cache
qa_ruling_task:
<<: *QA_TASK_FILTER
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 8
memory: 8G
<<: *SETUP_GRADLE_CACHE
ruling_script:
- *log_develocity_url_script
- source cirrus-env QA
- git submodule update --init its/sources
- ./gradlew ":its:ruling:test" --project-prop ruling
"-Dsonar.runtimeVersion=LATEST_RELEASE"
"-Dorchestrator.artifactory.accessToken=${ARTIFACTORY_ACCESS_TOKEN}"
"-DbuildNumber=$BUILD_NUMBER"
-I "${GRADLE_HOME}/init.d/repoxAuth.init.gradle.kts"
--info --stacktrace --console plain --no-daemon --build-cache
promote_task:
depends_on:
- build
- qa_plugin
- qa_ruling
eks_container:
<<: *CONTAINER_DEFINITION
cpu: 1
memory: 1G
env:
ARTIFACTORY_URL: VAULT[development/kv/data/repox data.url]
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]
promote_script:
- *log_develocity_url_script
- function gradle(){ ./gradlew "$@"; }; export -f gradle
- cirrus_promote_gradle multi