Skip to content

Instantly share code, notes, and snippets.

@rafeca
Created September 5, 2012 22:26
Show Gist options
  • Save rafeca/3646381 to your computer and use it in GitHub Desktop.
Save rafeca/3646381 to your computer and use it in GitHub Desktop.
Dirty fix for the following bug in jenkins build pipeline plugin: https://issues.jenkins-ci.org/browse/JENKINS-14656
diff -r 4a634fdf26e2 src/main/webapp/js/build-pipeline.js
--- a/src/main/webapp/js/build-pipeline.js Sat Aug 25 16:04:30 2012 -0700
+++ b/src/main/webapp/js/build-pipeline.js Wed Sep 05 23:24:46 2012 +0100
@@ -69,6 +69,18 @@
},
triggerBuild : function(id, upstreamProjectName, upstreamBuildNumber, triggerProjectName, dependencyIds) {
var buildPipeline = this;
+
+ // Ugly patch by rafeca to fix this bug: https://issues.jenkins-ci.org/browse/JENKINS-14656
+ var currentBox = $('#build-' + id);
+ var upstreamBox = currentBox.prevAll('[id|=build]');
+
+ if (!upstreamBox.length) {
+ var position = currentBox.parent().children().index(currentBox);
+ upstreamBox = $(currentBox.parent().prev('.build-pipeline').children()[position-1]).prevAll('[id|=build]');
+ }
+ upstreamProjectName = upstreamBox.find('span.pointer').attr('title');
+ // End Ugly patch by rafeca
+
buildPipeline.viewProxy.triggerManualBuild(upstreamBuildNumber, triggerProjectName, upstreamProjectName, function(data){
buildPipeline.updateNextBuildAndShowProgress(id, data.responseObject(), dependencyIds);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment