提交 4f0ea9da 编写于 作者: K Kohsuke Kawaguchi

[JENKINS-8446] pick more consistent default value if someone is installing Jenkins fresh

上级 68d4d22f
......@@ -236,7 +236,7 @@ public abstract class Slave extends Node implements Serializable {
public FilePath getWorkspaceFor(TopLevelItem item) {
FilePath r = getWorkspaceRoot();
if(r==null) return null; // offline
return r.child(item.getName());
return r.child(item.getFullName());
}
public FilePath getRootPath() {
......
......@@ -628,6 +628,11 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe
throw new IllegalStateException("second instance");
theInstance = this;
if (!new File(root,"jobs").exists()) {
// if this is a fresh install, use more modern default layout that's consistent with slaves
workspaceDir = "${JENKINS_HOME}/workspace/${ITEM_FULLNAME}";
}
// doing this early allows InitStrategy to set environment upfront
final InitStrategy is = InitStrategy.get(Thread.currentThread().getContextClassLoader());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册