Skip to content

Instantly share code, notes, and snippets.

@critical-bug
Created September 15, 2011 03:14
Show Gist options
  • Save critical-bug/1218430 to your computer and use it in GitHub Desktop.
Save critical-bug/1218430 to your computer and use it in GitHub Desktop.
userscript working with Jenkins, navigates to the console after triggered a build of the job.
// ==UserScript==
// @name go console after trigger
// @description [Jenkins] Go to the console after triggered a build of the job.
// @include http://*:8080/*/job/*/
// @include http://*:8080/job/*/
// ==/UserScript==
var jobUrl = unsafeWindow.location.href;
var referrer = unsafeWindow.document.referrer;
if (referrer.indexOf(jobUrl + "build") == 0) {
unsafeWindow.setTimeout(
function(){
unsafeWindow.location.href = jobUrl + "lastBuild/console";
},
5000 // usual build waits 5 sec
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment