[zorg] r318242 - jenkins: Do pseudo checkouts in relay jobs
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 16:47:57 PST 2017
Author: matze
Date: Tue Nov 14 16:47:57 2017
New Revision: 318242
URL: http://llvm.org/viewvc/llvm-project?rev=318242&view=rev
Log:
jenkins: Do pseudo checkouts in relay jobs
Relay jobs lacked blamelists/changelogs. This happened naturally because
we cannot communicate parameters/extra info to them to not loose the
feature of jenkins merging multiple jobs in a queue.
To get the changelists back the relay jobs are now modified to do a
pseudo checkout with all the relevant repositories (using depth: zero so
we shouldn't really spend time checking out files to disk) to get the
changelists back.
Modified:
zorg/trunk/zorg/jenkins/relay.groovy
Modified: zorg/trunk/zorg/jenkins/relay.groovy
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/zorg/jenkins/relay.groovy?rev=318242&r1=318241&r2=318242&view=diff
==============================================================================
--- zorg/trunk/zorg/jenkins/relay.groovy (original)
+++ zorg/trunk/zorg/jenkins/relay.groovy Tue Nov 14 16:47:57 2017
@@ -17,7 +17,28 @@ private def basename(path) {
return path.drop(path.lastIndexOf('/') + 1)
}
+// Do a pseudo checkout of an llvm repo to get the blamelist filled. This is
+// necessary for relay jobs as with current jenkins we do not want to trigger
+// the relay job with any parameters or blamelists. (If we would do that then
+// jenkins won't merge requests anymore and we would be forced to test
+// every single revision for which we don't have the hardware right now).
+private def pseudo_svn_checkout(name, url) {
+ dir("pseudo-checkout-${name}") {
+ checkout poll: false, changelog: true, scm: [
+ $class: 'SubversionSCM',
+ locations: [[
+ remote: url,
+ depthOption: 'empty',
+ ]]
+ ]
+ }
+}
+
private def relay_steps(job_pattern, artifact_url, last_good_properties_url) {
+ // The upstream jobs triggering the relay produce a
+ // "last_good_build.properties" file that contains a reference to the
+ // compiler artifact that should be used for this run and which llvm
+ // revision it is based on.
propfile = basename(last_good_properties_url)
sh """
rm -f ${propfile}
@@ -25,8 +46,15 @@ curl -fksSO "${last_good_properties_url}
"""
def props = readProperties file: propfile
def artifact = "http://labmaster2.local/artifacts/${props.ARTIFACT}"
- currentBuild.displayName = "r${props.LLVM_REV}"
+ currentBuild.setDisplayName("r${props.LLVM_REV}")
+
+ pseudo_svn_checkout 'llvm', "http://llvm.org/svn/llvm-project/llvm/trunk@${props.LLVM_REV}"
+ pseudo_svn_checkout 'cfe', "http://llvm.org/svn/llvm-project/cfe/trunk@${props.LLVM_REV}"
+ pseudo_svn_checkout 'clang-tools-extra', "http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@${props.LLVM_REV}"
+ pseudo_svn_checkout 'compiler-rt', "http://llvm.org/svn/llvm-project/compiler-rt/trunk@${props.LLVM_REV}"
+ pseudo_svn_checkout 'libcxx', "http://llvm.org/svn/llvm-project/libcxx/trunk@${props.LLVM_REV}"
+ // Trigger all jobs with names matching the `job_pattern` regex.
def joblist = get_matching_jobs(job_pattern)
def parallel_builds = [:]
for (j in joblist) {
@@ -49,8 +77,7 @@ def pipeline(job_pattern,
last_good_properties_url='http://labmaster2.local/artifacts/clang-stage1-configure-RA/last_good_build.properties') {
node('master') {
stage('main') {
- relay_steps(job_pattern, artifact_url,
- last_good_properties_url)
+ relay_steps job_pattern, artifact_url, last_good_properties_url
}
}
}
More information about the llvm-commits
mailing list