Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #124 from rpocase/master
[JENKINS-28179] Workspace suffix should respect hudon.slaves.WorkspaceList property
  • Loading branch information
jglick committed May 1, 2015
2 parents 0201a12 + b041852 commit b888a17b1af1fa0501c323c409985f4cfc887380
Showing with 10 additions and 1 deletion.
  1. +10 −1 cps/src/main/java/org/jenkinsci/plugins/workflow/cps/CpsScmFlowDefinition.java
@@ -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;
@@ -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());
}
@@ -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;

0 comments on commit b888a17

Please sign in to comment.