Skip to content

Commit 0ead6ed

Browse files
BUILD-7780: Use monthly cache for orchestrator
Signed-off-by: Jayadeep Kinavoor Madam <[email protected]>
1 parent 80ca7c8 commit 0ead6ed

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.cirrus.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,36 @@ windows_16_cpu_32G_template: &WINDOWS_16_CPU_32G
6363
preemptible: false
6464
use_ssd: true
6565

66+
orchestrator_cache_definition: &ORCHESTRATOR_CACHE_DEFINITION
67+
set_orchestrator_home_script: |
68+
# Check if SQ_VERSION exists and create an intermediary variable
69+
if [ -n "$SQ_VERSION" ]; then
70+
TASK_NAME_WITH_VERSION="${CIRRUS_TASK_NAME}-${SQ_VERSION}"
71+
else
72+
TASK_NAME_WITH_VERSION="${CIRRUS_TASK_NAME}"
73+
fi
74+
75+
echo "CURRENT_MONTH=$(date +"%B")" >> $CIRRUS_ENV
76+
echo "ORCHESTRATOR_HOME=${CIRRUS_WORKING_DIR}/orchestrator/${TASK_NAME_WITH_VERSION}/${CURRENT_MONTH}" >> $CIRRUS_ENV
77+
echo "TASK_NAME_WITH_VERSION=${TASK_NAME_WITH_VERSION}" >> $CIRRUS_ENV
78+
mkdir_orchestrator_home_script: |
79+
echo "Create dir ${ORCHESTRATOR_HOME} if needed"
80+
mkdir -p ${ORCHESTRATOR_HOME}
81+
orchestrator_cache:
82+
folder: ${ORCHESTRATOR_HOME}
83+
fingerprint_script: echo ${TASK_NAME_WITH_VERSION}-${CURRENT_MONTH}
84+
reupload_on_changes: "true"
85+
6686
setup_gradle_cache_template: &SETUP_GRADLE_CACHE
6787
gradle_cache:
6888
folder: .gradle/caches
6989
create_gradle_directory_script:
7090
- mkdir -p "${CIRRUS_WORKING_DIR}/.gradle"
7191

92+
debug_cache_template: &DEBUG_CACHE_TEMPLATE
93+
debug_cache_script:
94+
- tree ${ORCHESTRATOR_HOME}
95+
7296
cleanup_gradle_cache_script_template: &CLEANUP_GRADLE_CACHE_SCRIPT
7397
cleanup_gradle_script:
7498
- /usr/bin/find "${CIRRUS_WORKING_DIR}/.gradle/caches/" -name "*.lock" -type f -delete
@@ -78,6 +102,7 @@ cleanup_gradle_cache_script_template: &CLEANUP_GRADLE_CACHE_SCRIPT
78102

79103
gradle_its_template: &GRADLE_ITS_TEMPLATE
80104
<<: *SETUP_GRADLE_CACHE
105+
<<: *ORCHESTRATOR_CACHE_DEFINITION
81106
run_its_script:
82107
- |
83108
if [ -n "${GIT_SUB_MODULE}" ]; then
@@ -88,6 +113,7 @@ gradle_its_template: &GRADLE_ITS_TEMPLATE
88113
"-Dsonar.runtimeVersion=${SQ_VERSION}"
89114
"-DbuildNumber=$BUILD_NUMBER"
90115
--info --console plain --no-daemon --build-cache
116+
<<: *DEBUG_CACHE_SCRIPT
91117
<<: *CLEANUP_GRADLE_CACHE_SCRIPT
92118

93119
only_if_sonarsource_qa_template: &ONLY_IF_SONARSOURCE_QA
@@ -198,6 +224,7 @@ qa_ruling_kotlin_compiler_task:
198224
GIT_SUB_MODULE: "its/sources"
199225
<<: *LINUX_6_CPU_12G_JAVA_17
200226
<<: *SETUP_GRADLE_CACHE
227+
<<: *ORCHESTRATOR_CACHE_DEFINITION
201228
run_its_script:
202229
- |
203230
if [ -n "${GIT_SUB_MODULE}" ]; then

0 commit comments

Comments
 (0)