-
Notifications
You must be signed in to change notification settings - Fork 59
/
traefik.groovy
98 lines (85 loc) · 4.04 KB
/
traefik.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
92
93
94
95
96
97
98
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 = config.Jobs.traefik?.keySet()
for (JB in JOB_BRANCHES) {
JOB_BRANCH=""+JB
//check for jenkinsfile
FILE_CHECK = false
try {
fileCheck = readFileFromWorkspace('jobs/DS_CI/template_'+JB+'.jenkinsfile')
FILE_CHECK = true
}
catch(err) {
println "No jenkins file found for " + JB
}
if (FILE_CHECK) {
MIDSTM_BRANCH="devspaces-" + JOB_BRANCH.replaceAll(".x","") + "-rhel-9"
jobPath="${FOLDER_PATH}/${ITEM_NAME}_" + JOB_BRANCH
pipelineJob(jobPath){
disabled(config.Jobs.traefik[JB].disabled) // on reload of job, disable to avoid churn
UPSTM_NAME="traefik"
MIDSTM_NAME="traefik"
SOURCE_REPO="traefik/" + UPSTM_NAME
MIDSTM_REPO="redhat-developer/devspaces-images"
//No check since traefik uses a tag instead of a branch
SOURCE_BRANCH="master"
SOURCE_TAG=""+config.Jobs.traefik[JB].upstream_branch[0]
description('''
Artifact builder + sync job; triggers brew after syncing
<ul>
<li>Upstream: <a href=https://github.com/''' + SOURCE_REPO + '''>''' + UPSTM_NAME + '''</a></li>
<li>Midstream: <a href=https://github.com/redhat-developer/devspaces/tree/''' + MIDSTM_BRANCH + '''/dependencies/>dependencies</a></li>
<li>Downstream: <a href=https://pkgs.devel.redhat.com/cgit/containers/devspaces-''' + MIDSTM_NAME + '''?h=''' + MIDSTM_BRANCH + '''>''' + MIDSTM_NAME + '''</a></li>
</ul>
<p>If <b style="color:green">downstream job fires</b>, see
<a href=../sync-to-downstream_''' + JOB_BRANCH + '''/>sync-to-downstream</a>, then
<a href=../get-sources-rhpkg-container-build_''' + JOB_BRANCH + '''/>get-sources-rhpkg-container-build</a>. <br/>
If <b style="color:orange">job is yellow</b>, no changes found to push, so no container-build triggered. </p>
<p>Results:
<ul>
<li><a href=https://github.com/redhat-developer/devspaces-images/releases?q=%22assets+for+the+'''+
(config.CSVs."operator-bundle"[JB].CSV_VERSION)+
'''+'''+MIDSTM_NAME+'''+release%22&expanded=true>redhat-developer/devspaces-images/releases</a></li>
<li><a href=https://quay.io/devspaces/'''+MIDSTM_NAME+'''-rhel8>quay.io/devspaces/'''+MIDSTM_NAME+'''-rhel8</a></li>
</ul>
</p>
''')
properties {
githubProjectUrl("https://github.com/" + SOURCE_REPO)
// disabled because no changes in the branch / run this manually
// pipelineTriggers {
// triggers{
// pollSCM{
// scmpoll_spec("H H * * *") // every 24hrs
// }
// }
// }
disableResumeJobProperty()
}
logRotator {
daysToKeep(5)
numToKeep(5)
artifactDaysToKeep(2)
artifactNumToKeep(1)
}
parameters{
stringParam("SOURCE_REPO", SOURCE_REPO)
stringParam("SOURCE_BRANCH", SOURCE_BRANCH)
stringParam("SOURCE_TAG", SOURCE_TAG, "Fetch branch, then build from tag (if set)")
stringParam("MIDSTM_REPO", MIDSTM_REPO)
stringParam("MIDSTM_BRANCH", MIDSTM_BRANCH)
stringParam("MIDSTM_NAME", MIDSTM_NAME)
booleanParam("FORCE_BUILD", false, "If true, trigger a rebuild even if no changes were pushed to pkgs.devel")
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/template_'+JOB_BRANCH+'.jenkinsfile'))
}
}
}
}
}