-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathbuild-all-images.groovy
91 lines (81 loc) · 3.02 KB
/
build-all-images.groovy
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
import groovy.json.JsonSlurper
def curlCMD = "https://raw.githubusercontent.com/redhat-developer/devspaces/devspaces-3-rhel-9/dependencies/job-config.json".toURL().text
def jsonSlurper = new JsonSlurper();
def config = jsonSlurper.parseText(curlCMD);
def JOB_BRANCHES = ["3.x"] // only one job
for (JB in JOB_BRANCHES) {
//check for jenkinsfile
FILE_CHECK = false
try {
fileCheck = readFileFromWorkspace('jobs/DS_CI/Releng/build-all-images.jenkinsfile')
FILE_CHECK = true
}
catch(err) {
println "No jenkins file found for " + JB
}
if (FILE_CHECK) {
JOB_BRANCH=""+JB
MIDSTM_BRANCH="devspaces-" + JOB_BRANCH.replaceAll(".x","") + "-rhel-9"
jobPath="${FOLDER_PATH}/${ITEM_NAME}_" + JOB_BRANCH
pipelineJob(jobPath){
// disabled(config."Jobs"."build-all-images"[JB].disabled)
disabled(false)
description('''
<p>Since this build depends on multiple upstream repos, this build is configured
to trigger weekly on Sundays.
<p>
This job is meant to be used to orchestrate rebuilding everything in DS after a major branch update (7.yy.x -> 7.yy+1.x) or
for global CVE updates.
<p>Do not abuse this job!
''')
properties {
pipelineTriggers {
triggers{
cron {
// 3.x: Sun at 23:HH
spec("H H * * 0")
}
}
}
disableResumeJobProperty()
disableConcurrentBuildsJobProperty()
}
quietPeriod(86400) // limit builds to 1 every 24 hrs (in sec)
logRotator {
daysToKeep(5)
numToKeep(5)
artifactDaysToKeep(2)
artifactNumToKeep(2)
}
parameters{
stringParam("MIDSTM_BRANCH",MIDSTM_BRANCH)
stringParam("PHASES", "1 2 3", '''
Phases:
<ol>
<li> build internals in parallel (10 images):
<ul>
<li> configbump, operator, dashboard, imagepuller, machineexec, </li>
<li> pluginregistry, pluginregistry-plugins, server, traefik, udi</li>
</ul>
</li>
<li> build editors in parallel (2 images):
<ul>
<li> code [depends on machineexec and pluginregistry-plugins] </li>
<li> idea [depends on machineexec] </li>
</ul>
</li>
<li> build bundle image + IIBs</li>
</ol>
''')
stringParam("TIMEOUT", "600", "Override default timeout (in minutes) when building individual containers")
booleanParam("CLEAN_ON_FAILURE", true, "If false, don't clean up workspace after the build so it can be used for debugging.")
}
definition {
cps{
sandbox(true)
script(readFileFromWorkspace('jobs/DS_CI/Releng/build-all-images.jenkinsfile'))
}
}
}
}
}