Skip to content

Commit 9025e10

Browse files
committed
Make CLOUSEAU_JAVA_HOME configurable explicitly
Even though the build environments implictly configure the Java location that is specific to Clouseau via environment variables, it makes sense to make it possible for the developers to redefine the respective paths ad hoc. When upgrading to 3.x, it can even help with rerolling the container images only after the switch and avoid breaking the CI that may still run with Clouseau 2.x. Later this may become equally beneficial if the required Java versions are different from what other dependencies, e.g. Nouveau assume.
1 parent 1c30fbd commit 9025e10

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

build-aux/Jenkinsfile

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ meta = [
4040
spidermonkey_vsn: '60',
4141
with_nouveau: true,
4242
with_clouseau: true,
43+
clouseau_java_home: '/usr',
4344
quickjs_test262: true,
4445
image: "apache/couchdbci-centos:8-erlang-${ERLANG_VERSION}"
4546
],
@@ -49,6 +50,7 @@ meta = [
4950
spidermonkey_vsn: '78',
5051
with_nouveau: true,
5152
with_clouseau: true,
53+
clouseau_java_home: '/usr',
5254
quickjs_test262: true,
5355
image: "apache/couchdbci-centos:9-erlang-${ERLANG_VERSION}"
5456
],
@@ -58,6 +60,7 @@ meta = [
5860
spidermonkey_vsn: '91',
5961
with_nouveau: true,
6062
with_clouseau: true,
63+
clouseau_java_home: '/opt/java/openjdk',
6164
quickjs_test262: true,
6265
image: "apache/couchdbci-ubuntu:jammy-erlang-${ERLANG_VERSION}"
6366
],
@@ -67,6 +70,7 @@ meta = [
6770
spidermonkey_vsn: '115',
6871
with_nouveau: true,
6972
with_clouseau: true,
73+
clouseau_java_home: '/opt/java/openjdk',
7074
quickjs_test262: true,
7175
image: "apache/couchdbci-ubuntu:noble-erlang-${ERLANG_VERSION}"
7276
],
@@ -76,6 +80,7 @@ meta = [
7680
spidermonkey_vsn: '78',
7781
with_nouveau: true,
7882
with_clouseau: true,
83+
clouseau_java_home: '/opt/java/openjdk',
7984
quickjs_test262: true,
8085
image: "apache/couchdbci-debian:bullseye-erlang-${ERLANG_VERSION}"
8186
],
@@ -118,6 +123,7 @@ meta = [
118123
spidermonkey_vsn: '78',
119124
with_nouveau: true,
120125
with_clouseau: true,
126+
clouseau_java_home: '/opt/java/openjdk',
121127
// Test this in in the bookworm-quickjs variant
122128
quickjs_test262: false,
123129
image: "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}"
@@ -128,6 +134,7 @@ meta = [
128134
spidermonkey_vsn: '78',
129135
with_nouveau: true,
130136
with_clouseau: true,
137+
clouseau_java_home: '/opt/java/openjdk',
131138
quickjs_test262: false,
132139
image: "${DOCKER_IMAGE_BASE}-${MAXIMUM_ERLANG_VERSION}"
133140
],
@@ -137,6 +144,7 @@ meta = [
137144
disable_spidermonkey: true,
138145
with_nouveau: true,
139146
with_clouseau: true,
147+
clouseau_java_home: '/opt/java/openjdk',
140148
quickjs_test262: true,
141149
image: "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}"
142150
],
@@ -154,6 +162,7 @@ meta = [
154162
spidermonkey_vsn: '78',
155163
with_nouveau: true,
156164
with_clouseau: true,
165+
clouseau_java_home: '/opt/java/openjdk',
157166
// Test this in in the bookworm-quickjs variant
158167
quickjs_test262: false,
159168
image: "${DOCKER_IMAGE_BASE}-${ERLANG_VERSION}",
@@ -165,6 +174,7 @@ meta = [
165174
spidermonkey_vsn: '128',
166175
with_nouveau: true,
167176
with_clouseau: true,
177+
clouseau_java_home: '/opt/java/openjdk',
168178
quickjs_test262: true,
169179
image: "apache/couchdbci-debian:trixie-erlang-${ERLANG_VERSION}"
170180
],
@@ -205,6 +215,7 @@ meta = [
205215
name: 'Windows 2022',
206216
spidermonkey_vsn: '128',
207217
with_clouseau: true,
218+
clouseau_java_home: /C:\tools\zulu21.46.19-ca-jdk21.0.9-win_x64/,
208219
quickjs_test262: false,
209220
node_label: 'win'
210221
]
@@ -302,7 +313,12 @@ def generateNativeStage(platform) {
302313
powershell( script: "New-Item -ItemType Directory -Path '${platform}/build' -Force", label: 'Create build directories' )
303314
powershell( script: "tar -xf (Get-Item apache-couchdb-*.tar.gz) -C '${platform}/build' --strip-components=1", label: 'Unpack release' )
304315
dir( "${platform}/build" ) {
305-
withClouseau = meta[platform].with_clouseau ? '-WithClouseau' : ''
316+
def withClouseau = meta[platform].with_clouseau ? '-WithClouseau' : ''
317+
def setClouseauJavaHome = ''
318+
319+
if (meta[platform].clouseau_java_home) {
320+
setClouseauJavaHome = "Set-Item -Path env:CLOUSEAU_JAVA_HOME -Value '${meta[platform].clouseau_java_home}'"
321+
}
306322

307323
powershell( script: """
308324
.\\..\\..\\couchdb-glazier\\bin\\shell.ps1
@@ -317,12 +333,14 @@ def generateNativeStage(platform) {
317333
powershell( script: """
318334
.\\..\\..\\couchdb-glazier\\bin\\shell.ps1
319335
Set-Item -Path env:GRADLE_OPTS -Value '-Dorg.gradle.daemon=false'
336+
${setClouseauJavaHome}
320337
make -f Makefile.win elixir-search ERLANG_COOKIE=crumbles
321338
""", label: 'Clouseau tests')
322339

323340
powershell( script: """
324341
.\\..\\..\\couchdb-glazier\\bin\\shell.ps1
325342
Set-Item -Path env:GRADLE_OPTS -Value '-Dorg.gradle.daemon=false'
343+
${setClouseauJavaHome}
326344
make -f Makefile.win mango-test ERLANG_COOKIE=crumbles
327345
""", label: 'Mango tests')
328346

@@ -382,14 +400,20 @@ def generateContainerStage(platform) {
382400
sh( script: "mkdir -p ${platform}/build", label: 'Create build directories' )
383401
sh( script: "tar -xf apache-couchdb-*.tar.gz -C ${platform}/build --strip-components=1", label: 'Unpack release' )
384402
quickjs_tests262 = meta[platform].quickjs_test262
403+
def setClouseauJavaHome = ''
404+
405+
if (meta[platform].clouseau_java_home) {
406+
setClouseauJavaHome = "env CLOUSEAU_JAVA_HOME='${meta[platform].clouseau_java_home}' "
407+
}
408+
385409
dir( "${platform}/build" ) {
386410
sh "${configure(meta[platform])}"
387411
sh 'make'
388412
retry(3) {sh 'make eunit'}
389413
if (meta[platform].quickjs_test262) {retry(3) {sh 'make quickjs-test262'}}
390414
retry(3) {sh 'make elixir'}
391-
retry(3) {sh 'make elixir-search'}
392-
retry(3) {sh 'make mango-test'}
415+
retry(3) {sh "${setClouseauJavaHome}make elixir-search"}
416+
retry(3) {sh "${setClouseauJavaHome}make mango-test"}
393417
retry(3) {sh 'make weatherreport-test'}
394418
retry(3) {sh 'make nouveau-test'}
395419
}

0 commit comments

Comments
 (0)