提交 c86aa679 编写于 作者: K Kohsuke Kawaguchi

Enabled concurrent build support for matrix projects

上级 039b359a
...@@ -57,6 +57,8 @@ Upcoming changes</a> ...@@ -57,6 +57,8 @@ Upcoming changes</a>
<ul class=image> <ul class=image>
<li class=rfe> <li class=rfe>
Exposed plugin manager and update center to the REST API Exposed plugin manager and update center to the REST API
<li class=rfe>
Enabled concurrent build support for matrix projects
</ul> </ul>
</div><!--=TRUNK-END=--> </div><!--=TRUNK-END=-->
......
...@@ -78,6 +78,16 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun> ...@@ -78,6 +78,16 @@ public class MatrixConfiguration extends Project<MatrixConfiguration,MatrixRun>
super.onLoad(parent, combination.toString()); super.onLoad(parent, combination.toString());
} }
@Override
public boolean isConcurrentBuild() {
return getParent().isConcurrentBuild();
}
@Override
public void setConcurrentBuild(boolean b) throws IOException {
throw new UnsupportedOperationException("The setting can be only changed at MatrixProject");
}
/** /**
* Used during loading to set the combination back. * Used during loading to set the combination back.
*/ */
......
...@@ -299,7 +299,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A ...@@ -299,7 +299,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
*/ */
@Exported @Exported
public boolean isConcurrentBuild() { public boolean isConcurrentBuild() {
return Jenkins.CONCURRENT_BUILD && concurrentBuild; return concurrentBuild;
} }
public void setConcurrentBuild(boolean b) throws IOException { public void setConcurrentBuild(boolean b) throws IOException {
......
...@@ -213,6 +213,8 @@ import org.jvnet.hudson.reactor.TaskBuilder; ...@@ -213,6 +213,8 @@ import org.jvnet.hudson.reactor.TaskBuilder;
import org.jvnet.hudson.reactor.TaskGraphBuilder; import org.jvnet.hudson.reactor.TaskGraphBuilder;
import org.jvnet.hudson.reactor.Reactor; import org.jvnet.hudson.reactor.Reactor;
import org.jvnet.hudson.reactor.TaskGraphBuilder.Handle; import org.jvnet.hudson.reactor.TaskGraphBuilder.Handle;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.args4j.Argument; import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option; import org.kohsuke.args4j.Option;
import org.kohsuke.stapler.Ancestor; import org.kohsuke.stapler.Ancestor;
...@@ -3802,7 +3804,10 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe ...@@ -3802,7 +3804,10 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe
* When we merge this back to the trunk, this allows us to keep * When we merge this back to the trunk, this allows us to keep
* this feature hidden for a while until we iron out the kinks. * this feature hidden for a while until we iron out the kinks.
* @see AbstractProject#isConcurrentBuild() * @see AbstractProject#isConcurrentBuild()
* @deprecated as of 1.464
* This flag will have no effect.
*/ */
@Restricted(NoExternalUse.class)
public static boolean CONCURRENT_BUILD = true; public static boolean CONCURRENT_BUILD = true;
/** /**
......
...@@ -30,6 +30,7 @@ THE SOFTWARE. ...@@ -30,6 +30,7 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project"> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<p:config-disableBuild/> <p:config-disableBuild/>
<p:config-concurrentBuild />
<f:section title="${%Advanced Project Options}"> <f:section title="${%Advanced Project Options}">
<f:advanced> <f:advanced>
......
...@@ -29,9 +29,7 @@ THE SOFTWARE. ...@@ -29,9 +29,7 @@ THE SOFTWARE.
<?jelly escape-by-default='true'?> <?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:p="/lib/hudson/project" xmlns:this="this"> <j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:p="/lib/hudson/project" xmlns:this="this">
<p:config-disableBuild/> <p:config-disableBuild/>
<j:if test="${app.CONCURRENT_BUILD}"> <p:config-concurrentBuild />
<f:optionalBlock field="concurrentBuild" title="${%title.concurrentbuilds}" />
</j:if>
<j:set var="jdks" value="${app.JDKs}" /> <j:set var="jdks" value="${app.JDKs}" />
<j:if test="${jdks.size() gt 1}"> <j:if test="${jdks.size() gt 1}">
......
...@@ -22,5 +22,4 @@ ...@@ -22,5 +22,4 @@
default.value=(Default) default.value=(Default)
Advanced\ Project\ Options\ configure-common=Advanced Project Options Advanced\ Project\ Options\ configure-common=Advanced Project Options
title.concurrentbuilds=Execute concurrent builds if necessary
Display\ Name=Display Name Display\ Name=Display Name
...@@ -23,6 +23,5 @@ ...@@ -23,6 +23,5 @@
Label\ Expression=Etiketudtryk Label\ Expression=Etiketudtryk
default.value=(Standard) default.value=(Standard)
Restrict\ where\ this\ project\ can\ be\ run=Begr\u00e6ns hvor dette projekt kan k\u00f8res Restrict\ where\ this\ project\ can\ be\ run=Begr\u00e6ns hvor dette projekt kan k\u00f8res
title.concurrentbuilds=K\u00f8r parallelle byg om n\u00f8dvendigt
Advanced\ Project\ Options\ configure-common=Avancerede projektindstillinger Advanced\ Project\ Options\ configure-common=Avancerede projektindstillinger
JDK\ to\ be\ used\ for\ this\ project=JDK der skal benyttes til dette projekt JDK\ to\ be\ used\ for\ this\ project=JDK der skal benyttes til dette projekt
...@@ -23,6 +23,5 @@ ...@@ -23,6 +23,5 @@
JDK\ to\ be\ used\ for\ this\ project=JDK, das für dieses Projekt verwendet wird JDK\ to\ be\ used\ for\ this\ project=JDK, das für dieses Projekt verwendet wird
default.value=(Vorgabewert) default.value=(Vorgabewert)
Advanced\ Project\ Options\ configure-common=Erweiterte Projekteinstellungen Advanced\ Project\ Options\ configure-common=Erweiterte Projekteinstellungen
title.concurrentbuilds=Parallele Builds ausführen, wenn notwendig
Restrict\ where\ this\ project\ can\ be\ run=Beschränke wo dieses Projekt ausgeführt werden darf Restrict\ where\ this\ project\ can\ be\ run=Beschränke wo dieses Projekt ausgeführt werden darf
Label\ Expression=Label-Ausdruck Label\ Expression=Label-Ausdruck
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
default.value=(por defecto) default.value=(por defecto)
Advanced\ Project\ Options\ configure-common=Opciones avanzadas del proyecto Advanced\ Project\ Options\ configure-common=Opciones avanzadas del proyecto
title.concurrentbuilds=Lanzar ejecuciones concurrentes en caso de ser necesario
JDK\ to\ be\ used\ for\ this\ project=JDK que se debe usar para este proyecto JDK\ to\ be\ used\ for\ this\ project=JDK que se debe usar para este proyecto
Label\ Expression=Expresión Label\ Expression=Expresión
Restrict\ where\ this\ project\ can\ be\ run=Restringir dónde se puede ejecutar este proyecto. Restrict\ where\ this\ project\ can\ be\ run=Restringir dónde se puede ejecutar este proyecto.
...@@ -26,4 +26,3 @@ Node=Noeud ...@@ -26,4 +26,3 @@ Node=Noeud
Execute\ concurrent\ builds\ if\ necessary\ =Ex\u00E9cuter les builds en parall\u00E8le si n\u00E9cessaire Execute\ concurrent\ builds\ if\ necessary\ =Ex\u00E9cuter les builds en parall\u00E8le si n\u00E9cessaire
JDK\ to\ be\ used\ for\ this\ project=Le JDK à utiliser pour ce projet JDK\ to\ be\ used\ for\ this\ project=Le JDK à utiliser pour ce projet
default.value=(Valeur par défaut) default.value=(Valeur par défaut)
title.concurrentbuilds=Ex\u00E9cuter des builds simultan\u00E9ment si n\u00E9cessaire
...@@ -21,4 +21,3 @@ ...@@ -21,4 +21,3 @@
# THE SOFTWARE. # THE SOFTWARE.
Advanced\ Project\ Options\ configure-common=Opzioni avanzate del progetto Advanced\ Project\ Options\ configure-common=Opzioni avanzate del progetto
title.concurrentbuilds=Esegui build in concorrenza se necessario (beta)
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
JDK\ to\ be\ used\ for\ this\ project=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308bJDK JDK\ to\ be\ used\ for\ this\ project=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u4f7f\u7528\u3059\u308bJDK
Advanced\ Project\ Options\ configure-common=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u9ad8\u5ea6\u306a\u30aa\u30d7\u30b7\u30e7\u30f3 Advanced\ Project\ Options\ configure-common=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u9ad8\u5ea6\u306a\u30aa\u30d7\u30b7\u30e7\u30f3
default.value=\u30c7\u30d5\u30a9\u30eb\u30c8 default.value=\u30c7\u30d5\u30a9\u30eb\u30c8
title.concurrentbuilds=\u53ef\u80fd\u3067\u3042\u308c\u3070\u4e26\u884c\u3057\u3066\u30d3\u30eb\u30c9
Restrict\ where\ this\ project\ can\ be\ run=\u5b9f\u884c\u3059\u308b\u30ce\u30fc\u30c9\u3092\u5236\u9650 Restrict\ where\ this\ project\ can\ be\ run=\u5b9f\u884c\u3059\u308b\u30ce\u30fc\u30c9\u3092\u5236\u9650
Label\ Expression=\u30e9\u30d9\u30eb\u5f0f Label\ Expression=\u30e9\u30d9\u30eb\u5f0f
Display\ Name=\u8868\u793a\u7528\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d Display\ Name=\u8868\u793a\u7528\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d
...@@ -24,7 +24,5 @@ Advanced\ Project\ Options\ configure-common=Op\u00e7\u00f5es Avan\u00e7adas do ...@@ -24,7 +24,5 @@ Advanced\ Project\ Options\ configure-common=Op\u00e7\u00f5es Avan\u00e7adas do
# (Default) # (Default)
default.value=Default default.value=Default
Node=N\u00f3 Node=N\u00f3
# Execute concurrent builds if necessary (beta)
title.concurrentbuilds=Execute as construcoes se necessario
Tie\ this\ project\ to\ a\ node=Vincular esse projeto a um N\u00f3 Tie\ this\ project\ to\ a\ node=Vincular esse projeto a um N\u00f3
JDK\ to\ be\ used\ for\ this\ project=Necess\u00e1rio usar JDK nesse projeto JDK\ to\ be\ used\ for\ this\ project=Necess\u00e1rio usar JDK nesse projeto
...@@ -21,4 +21,3 @@ ...@@ -21,4 +21,3 @@
# THE SOFTWARE. # THE SOFTWARE.
Advanced\ Project\ Options\ configure-common=\u9AD8\u7EA7\u9879\u76EE\u9009\u9879 Advanced\ Project\ Options\ configure-common=\u9AD8\u7EA7\u9879\u76EE\u9009\u9879
title.concurrentbuilds=\u5728\u5FC5\u8981\u7684\u65F6\u5019\u5E76\u53D1\u6784\u5EFA
<!--
The MIT License
Copyright (c) 2012, CloudBees, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<!--
Configuration entry for concurrent build
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<f:optionalBlock field="concurrentBuild" title="${%title.concurrentbuilds}" />
</j:jelly>
\ No newline at end of file
# the mit license
#
# copyright (c) 2004-2012, sun microsystems, inc., kohsuke kawaguchi, eric lefevre-ardant
#
# permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "software"), to deal
# in the software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Execute concurrent builds if necessary
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc. Kohsuke Kawaguchi. Knud Poulsen.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=K\u00f8r parallelle byg om n\u00f8dvendigt
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Simon Wiest
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Parallele Builds ausf?hren, wenn notwendig
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Lanzar ejecuciones concurrentes en caso de ser necesario
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Eric Lefevre-Ardant
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Ex\u00E9cuter des builds simultan\u00E9ment si n\u00E9cessaire
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Esegui build in concorrenza se necessario (beta)
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Reginaldo L. Russinholi, Cleiber Silva
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=Execute as construcoes se necessario
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
title.concurrentbuilds=\u5728\u5FC5\u8981\u7684\u65F6\u5019\u5E76\u53D1\u6784\u5EFA
...@@ -189,7 +189,7 @@ THE SOFTWARE. ...@@ -189,7 +189,7 @@ THE SOFTWARE.
<dependency> <dependency>
<groupId>org.jenkins-ci.main</groupId> <groupId>org.jenkins-ci.main</groupId>
<artifactId>remoting</artifactId> <artifactId>remoting</artifactId>
<version>2.14</version> <version>2.13</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -53,6 +53,9 @@ import hudson.model.FileParameterDefinition ...@@ -53,6 +53,9 @@ import hudson.model.FileParameterDefinition
import hudson.model.Cause.LegacyCodeCause import hudson.model.Cause.LegacyCodeCause
import hudson.model.ParametersAction import hudson.model.ParametersAction
import hudson.model.FileParameterValue import hudson.model.FileParameterValue
import org.jvnet.hudson.test.MockBuilder
import org.jvnet.hudson.test.SleepBuilder
import java.util.concurrent.CountDownLatch
/** /**
* *
...@@ -327,4 +330,41 @@ public class MatrixProjectTest extends HudsonTestCase { ...@@ -327,4 +330,41 @@ public class MatrixProjectTest extends HudsonTestCase {
assertBuildStatusSuccess(f.get(10,TimeUnit.SECONDS)); assertBuildStatusSuccess(f.get(10,TimeUnit.SECONDS));
} }
/**
* Verifies that the concurrent build feature works, and makes sure
* that each gets its own unique workspace.
*/
void testConcurrentBuild() {
jenkins.numExecutors = 10
jenkins.updateComputerList()
def p = createMatrixProject()
p.axes = new AxisList(new TextAxis("foo","1","2"))
p.concurrentBuild = true;
def latch = new CountDownLatch(4)
def dirs = Collections.synchronizedSet(new HashSet())
p.buildersList.add(new TestBuilder() {
boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) {
dirs << build.workspace.getRemote()
def marker = build.workspace.child("file")
def name = build.fullDisplayName
marker.write(name,"UTF-8")
latch.countDown()
latch.await()
assertEquals(name,marker.readToString())
return true
}
})
// should have gotten all unique names
def f1 = p.scheduleBuild2(0)
// get one going
Thread.sleep(1000)
def f2 = p.scheduleBuild2(0)
[f1,f2]*.get().each{ assertBuildStatusSuccess(it)}
assertEquals 4, dirs.size()
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册