Merge "Fix timeout wrapper version detection"
This commit is contained in:
commit
ed07d8fa94
@ -311,14 +311,19 @@ def timeout(registry, xml_parent, data):
|
||||
prefix = 'hudson.plugins.build__timeout.'
|
||||
twrapper = XML.SubElement(xml_parent, prefix + 'BuildTimeoutWrapper')
|
||||
|
||||
plugin_info = registry.get_plugin_info(
|
||||
"Jenkins build timeout plugin")
|
||||
version = pkg_resources.parse_version(plugin_info.get("version", "0"))
|
||||
plugin_info = registry.get_plugin_info("Build Timeout")
|
||||
if "version" not in plugin_info:
|
||||
plugin_info = registry.get_plugin_info("Jenkins build timeout plugin")
|
||||
version = plugin_info.get("version", None)
|
||||
if version:
|
||||
version = pkg_resources.parse_version(version)
|
||||
|
||||
valid_strategies = ['absolute', 'no-activity', 'likely-stuck', 'elastic',
|
||||
'deadline']
|
||||
|
||||
if version >= pkg_resources.parse_version("1.14"):
|
||||
# NOTE(toabctl): if we don't know the version assume that we
|
||||
# use a newer version of the plugin
|
||||
if not version or version >= pkg_resources.parse_version("1.14"):
|
||||
strategy = data.get('type', 'absolute')
|
||||
if strategy not in valid_strategies:
|
||||
InvalidAttributeError('type', strategy, valid_strategies)
|
||||
|
@ -110,12 +110,14 @@ print("Doing something cool with python")
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper>
|
||||
<buildSteps>
|
||||
|
@ -2,13 +2,13 @@
|
||||
<project>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy">
|
||||
<timeoutMinutes>90</timeoutMinutes>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
<timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<timeoutPercentage>0</timeoutPercentage>
|
||||
<timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
|
||||
<timeoutType>absolute</timeoutType>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
||||
|
@ -2,12 +2,12 @@
|
||||
<project>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.LikelyStuckTimeOutStrategy">
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>false</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<timeoutPercentage>0</timeoutPercentage>
|
||||
<timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
|
||||
<timeoutType>likelyStuck</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.AbortOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
@ -2,13 +2,15 @@
|
||||
<project>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
<timeoutEnvVar>BUILD_TIMEOUT</timeoutEnvVar>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
||||
|
@ -114,12 +114,14 @@ print("Doing something cool with python")
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper>
|
||||
<buildSteps>
|
||||
|
@ -23,12 +23,14 @@
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper>
|
||||
<buildSteps>
|
||||
|
@ -23,12 +23,14 @@
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper>
|
||||
<buildSteps>
|
||||
|
@ -33,12 +33,14 @@ echo "Doing somethiung cool"
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
||||
|
@ -30,12 +30,14 @@ VERSION="1.1"
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
</buildWrappers>
|
||||
</project>
|
||||
|
@ -30,12 +30,14 @@ VERSION="1.2"
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<timeoutMinutes>3</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.ElasticTimeOutStrategy">
|
||||
<timeoutPercentage>150</timeoutPercentage>
|
||||
<numberOfBuilds>0</numberOfBuilds>
|
||||
<timeoutMinutesElasticDefault>90</timeoutMinutesElasticDefault>
|
||||
<timeoutType>elastic</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<org.jenkinsci.plugins.preSCMbuildstep.PreSCMBuildStepsWrapper>
|
||||
<buildSteps>
|
||||
|
@ -13,12 +13,12 @@
|
||||
<publishers/>
|
||||
<buildWrappers>
|
||||
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<strategy class="hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy">
|
||||
<timeoutMinutes>180</timeoutMinutes>
|
||||
<failBuild>true</failBuild>
|
||||
<writingDescription>false</writingDescription>
|
||||
<timeoutPercentage>0</timeoutPercentage>
|
||||
<timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
|
||||
<timeoutType>absolute</timeoutType>
|
||||
</strategy>
|
||||
<operationList>
|
||||
<hudson.plugins.build__timeout.operations.FailOperation/>
|
||||
</operationList>
|
||||
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
|
||||
<hudson.plugins.timestamper.TimestamperBuildWrapper/>
|
||||
</buildWrappers>
|
||||
|
Loading…
Reference in New Issue
Block a user