Skip to content

Commit

Permalink
[JENKINS-35000] Incorrect file backslash when slave is linux (#42)
Browse files Browse the repository at this point in the history
Incorrect file backslash when slave is linux and master is windows
  • Loading branch information
MarkRx authored and carlossg committed May 31, 2016
1 parent 54e0462 commit 46d450d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/com/cloudbees/dockerpublish/DockerBuilder.java
Expand Up @@ -8,6 +8,7 @@
import hudson.Launcher;
import hudson.Util;
import hudson.model.BuildListener;
import hudson.model.Node;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.tasks.BuildStepDescriptor;
Expand Down Expand Up @@ -341,8 +342,18 @@ private boolean maybeTagOnly() throws MacroEvaluationException, IOException, Int
}

private boolean buildAndTag() throws MacroEvaluationException, IOException, InterruptedException {
FilePath context = defined(expandAll(getBuildContext())) ? new FilePath(new File(expandAll(getBuildContext())))
: build.getWorkspace();
FilePath context;
if (defined(expandAll(getBuildContext()))) {
Node builtOn = build.getBuiltOn();

if (builtOn != null) {
context = builtOn.createPath(expandAll(getBuildContext()));
} else {
context = new FilePath(new File(expandAll(getBuildContext())));
}
} else {
context = build.getWorkspace();
}
Iterator<ImageTag> i = getImageTags().iterator();
Result lastResult = new Result();
if (i.hasNext()) {
Expand Down

0 comments on commit 46d450d

Please sign in to comment.