Skip to content

Commit cf09cea

Browse files
authored
Merge pull request #21802 from AdamBrousseau/bootjdk_cleanup_job
Add jenkins script for bootjdk cleanup
2 parents 2d480d1 + 4d87ccc commit cf09cea

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*******************************************************************************
2+
* Copyright IBM Corp. and others 2025
3+
*
4+
* This program and the accompanying materials are made available under
5+
* the terms of the Eclipse Public License 2.0 which accompanies this
6+
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
7+
* or the Apache License, Version 2.0 which accompanies this distribution and
8+
* is available at https://www.apache.org/licenses/LICENSE-2.0.
9+
*
10+
* This Source Code may also be made available under the following
11+
* Secondary Licenses when the conditions for such availability set
12+
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
13+
* General Public License, version 2 with the GNU Classpath
14+
* Exception [1] and GNU General Public License, version 2 with the
15+
* OpenJDK Assembly Exception [2].
16+
*
17+
* [1] https://www.gnu.org/software/classpath/license.html
18+
* [2] https://openjdk.org/legal/assembly-exception.html
19+
*
20+
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0 OR GPL-2.0-only WITH OpenJDK-assembly-exception-1.0
21+
*******************************************************************************/
22+
23+
// Remove all bootjdks from build machines.
24+
// Trigger initially setup for every 6 months.
25+
// Fire downstream job "all-nodes-matching-labels" with various params in parallel.
26+
27+
def defaultLocation = '$HOME/bootjdks'
28+
def slackChannel = params.SLACK_CHANNEL ?: '#jenkins-sandbox'
29+
30+
// Do not run on z/OS.
31+
def GROUPS = [
32+
[name:"AIX", labels:"ci.role.build&&sw.os.aix", location:"/opt/bootjdks"],
33+
[name:"alinux", labels:"ci.role.build&&sw.os.linux&&hw.arch.aarch64", location:defaultLocation],
34+
[name:"plinux", labels:"ci.role.build&&sw.os.linux&&hw.arch.ppc64le", location:defaultLocation],
35+
[name:"xlinux", labels:"ci.role.build&&sw.os.linux&&hw.arch.x86", location:defaultLocation],
36+
[name:"zlinux", labels:"ci.role.build&&sw.os.linux&&hw.arch.s390x", location:defaultLocation],
37+
[name:"Mac", labels:"ci.role.build&&sw.os.mac", location:defaultLocation],
38+
[name:"Windows", labels:"ci.role.build&&sw.os.windows", location:defaultLocation]
39+
]
40+
41+
branches = [:]
42+
for (i in GROUPS) {
43+
// def local variable for each loop to avoid all iterations using the last value of 'i'.
44+
def group = i
45+
branches["${group.name}"] = {
46+
build job: 'all-nodes-matching-labels',
47+
parameters: [
48+
string(name: 'LABEL', value: group.labels),
49+
string(name: 'COMMAND', value: "rm -rf ${group.location}/*"),
50+
string(name: 'TIMEOUT_TIME', value: '12'),
51+
booleanParam(name: 'PARALLEL', value: true),
52+
booleanParam(name: 'CLEANUP', value: false)
53+
]
54+
}
55+
}
56+
try {
57+
parallel branches
58+
} catch(e) {
59+
slackSend channel: slackChannel, color: 'danger', message: "Failed: ${env.JOB_NAME} #${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
60+
throw e
61+
}

0 commit comments

Comments
 (0)