Skip to content

Commit

Permalink
[JENKINS-8446] pick more consistent default value if someone is insta…
Browse files Browse the repository at this point in the history
…lling Jenkins fresh
  • Loading branch information
kohsuke committed Jul 6, 2011
1 parent 68d4d22 commit 4f0ea9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/hudson/model/Slave.java
Expand Up @@ -236,7 +236,7 @@ public Computer createComputer() {
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() {
Expand Down
5 changes: 5 additions & 0 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -628,6 +628,11 @@ protected Jenkins(File root, ServletContext context, PluginManager pluginManager
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}";

This comment has been minimized.

Copy link
@jglick

jglick Mar 9, 2013

Member

Unless I am missing something, this has no effect unless you happen to save global configuration in the initial session, because in the next session the jobs directory will exist (assuming you create one) and the default value of workspaceDir will be in effect. Did you mean to save() after this?

}

// doing this early allows InitStrategy to set environment upfront
final InitStrategy is = InitStrategy.get(Thread.currentThread().getContextClassLoader());

Expand Down

0 comments on commit 4f0ea9d

Please sign in to comment.