提交 1623160e 编写于 作者: O Oliver Gondža

Merge pull request #919 from LarryNorth/JENKINS-17603

......@@ -131,6 +131,17 @@ public class BuildCommand extends CLICommand {
}
}
if (!job.isBuildable()) {
String msg = Messages.BuildCommand_CLICause_CannotBuildUnknownReasons(job.getFullDisplayName());
if (job.isDisabled()) {
msg = Messages.BuildCommand_CLICause_CannotBuildDisabled(job.getFullDisplayName());
} else if (job.isHoldOffBuildUntilSave()){
msg = Messages.BuildCommand_CLICause_CannotBuildConfigNotSaved(job.getFullDisplayName());
}
stderr.println(msg);
return -1;
}
QueueTaskFuture<? extends AbstractBuild> f = job.scheduleBuild2(0, new CLICause(Jenkins.getAuthentication().getName()), a);
if (wait || sync) {
......
......@@ -254,7 +254,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
return new TextFile(new File(this.getRootDir(), "nextBuildNumber"));
}
protected synchronized boolean isHoldOffBuildUntilSave() {
public synchronized boolean isHoldOffBuildUntilSave() {
return holdOffBuildUntilSave;
}
......
......@@ -57,3 +57,9 @@ UpdateJobCommand.ShortDescription=\
UpdateNodeCommand.ShortDescription=\
Updates the node definition XML from stdin. The opposite of the get-node command
BuildCommand.CLICause.ShortDescription=Started by command line by {0}
BuildCommand.CLICause.CannotBuildDisabled=\
Cannot build {0} because it is disabled.
BuildCommand.CLICause.CannotBuildConfigNotSaved=\
Cannot build {0} because its configuration has not been saved.
BuildCommand.CLICause.CannotBuildUnknownReasons=\
Cannot build {0} for unknown reasons.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册