Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #124 from rpocase/master
Browse files Browse the repository at this point in the history
[JENKINS-28179] Workspace suffix should respect hudon.slaves.WorkspaceList property
  • Loading branch information
jglick committed May 1, 2015
2 parents 0201a12 + b041852 commit b888a17
Showing 1 changed file with 10 additions and 1 deletion.
Expand Up @@ -40,6 +40,7 @@
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import javax.inject.Inject;
import jenkins.model.Jenkins;
import org.jenkinsci.plugins.workflow.cps.persistence.PersistIn;
Expand Down Expand Up @@ -91,7 +92,7 @@ public String getScriptPath() {
if (baseWorkspace == null) {
throw new IOException(node.getDisplayName() + " may be offline");
}
dir = baseWorkspace.withSuffix("@script");
dir = getFilePathWithSuffix(baseWorkspace);
} else { // should not happen, but just in case:
dir = new FilePath(owner.getRootDir());
}
Expand Down Expand Up @@ -119,6 +120,14 @@ public String getScriptPath() {
return exec;
}

private FilePath getFilePathWithSuffix(FilePath baseWorkspace) {
return baseWorkspace.withSuffix(getFilePathSuffix() + "script");
}

private String getFilePathSuffix() {
return System.getProperty(WorkspaceList.class.getName(), "@");
}

@Extension public static class DescriptorImpl extends FlowDefinitionDescriptor {

@Inject public Snippetizer snippetizer;
Expand Down

0 comments on commit b888a17

Please sign in to comment.