jenkinsci / build-timeout-plugin

Jenkins build-timeout plugin
https://plugins.jenkins.io/build-timeout/
31 stars 80 forks source link

expose the build timeout with an environment variable #21

Closed zaro0508 closed 10 years ago

zaro0508 commented 10 years ago

It would be nice to have the jenkins job timeout available during the entire build. Tests, particularly long running tests, can make use of the timeout to evaluate and do stuff during a test run. Currently the work around is to set the timeout value in the jenkins timeout plugin then (using the envinject plugin) inject that value into job as an environment variable so that it's available globally to the job. Although this works it's not a great solution especially if you have tons of projects that needs to be updated with that workaround. Also any workaround would requires two plugins while this functionality can easily be accomplished with just the build timeout plugin.

This change allows users to set the build timeout to a custom environment variable. By default the plugin does not set a variable at all, users must explicitly enter a value into the 'Time-out variable' textbox for the plugin to add the environment variable to a build.

Also added tests to verify this feature.

cloudbees-pull-request-builder commented 10 years ago

plugins » build-timeout-plugin #29 UNSTABLE Looks like there's a problem with this pull request

zaro0508 commented 10 years ago

I forgot to commit one change.