Skip to main content

How to get upstream job status in Hudson from downstream jobs statuses

This is step-by-step instruction based on this blog: http://fatalfailure.wordpress.com/2011/06/14/jenkins-hudson-getting-the-overall-status-in-the-upstream-job-from-the-downstream-jobs/

Upstream job configuration

1. Adding downstream jobs
a) In 'Post-build Actions' section set 'Build other projects' checkbox
b) Add downstream jobs in 'Build other projects', separated by comma
c) Set 'Trigger even if the build is unstable'
2. Setting up fingerprinting to connect upstream job with downstream jobs
a) In 'Post-build Actions' section set 'Record fingerprints of files to track usage' checkbox
b) Set '**' in 'Files to fingerprint' field
c) Set 'Keep the build logs of dependencies' checkbox

Downstream jobs configuration

1. Setting up fingerprinting to connect upstream job with downstream jobs
a) In 'Post-build Actions' section set 'Record fingerprints of files to track usage' checkbox
b) Set '**' in 'Files to fingerprint' field
c) Set 'Keep the build logs of dependencies' checkbox
2. Updating the status of upstream job to reflect the statuses of downstream jobs
a) In 'Post-build Actions' section set 'Groovy Postbuild' checkbox
b) Enter the following code in 'Groovy script' field:
upstreamBuilds = manager.build.getUpstreamBuilds();
upstreamJob = upstreamBuilds.keySet().iterator().next();
lastUpstreamBuild = upstreamJob.getLastBuild();
if(lastUpstreamBuild.getResult().isBetterThan(manager.build.result)) {
    lastUpstreamBuild.setResult(manager.build.result);
}

Popular posts from this blog

Switching between keyboard layouts in Openbox (Arch Linux)

Switching between two (or more) keyboard layouts in Openbox DE is a task that's quite easy to accomplish, although it might not be so obvious as in other desktop environments. This solution was tested on Arch Linux. You just need to edit this file (assuming you want to switch between English and Ukrainian Phonetic layouts with Alt-Shift): /etc/X11/xorg.conf.d/01-keyboard-layout.conf Section "InputClass" Identifier "keyboard-layout" Driver "evdev" MatchIsKeyboard "yes" Option "XkbLayout" "us,ua(phonetic)" Option "XkbModel" "pc105" Option "XkbOptions" "grp:alt_shift_toggle" EndSection If you have Nvidia card, don't forget to edit /etc/X11/xorg.conf.d/20-nvidia.conf and change Driver from "kbd" to "evdev" in InputDevice section: Section "InputDevice" Identifier "Keyboard0" Driver "evdev" EndSection Y...

How to control CPU frequency on Linux Fedora 20

Sometimes you need to make CPU run faster or slower, depending on your needs. In Linux you can control this by using different CPU governors. The following steps were tested on Fedora 20, but most likely they would also work on later versions of Linux Fedora OS. sudo yum install kernel-tools Check the available CPU governors: sudo cpupower frequency-info --governors sudo cpupower frequency-set --governor [governor] More information about the governors here: http://docs.fedoraproject.org/en-US/Fedora/20/html/Power_Management_Guide/cpufreq_governors.html

Using querySelector in Selenium WebDriver

Sometimes it's very helpful if we are able to click some element directly, by calling JavaScript click event. For example, this can be the case when the element is not visible, or not clickable, thus we cannot use native WebDriver methods. WebDriver driver = new FirefoxDriver(); JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("document.querySelector('.pane .object_options .dropdown-toggle span').click();");