Skip to content

Commit

Permalink
Fixes JENKINS-22848.
Browse files Browse the repository at this point in the history
Resolve file path on remote for slave nodes.
  • Loading branch information
b2jrock committed May 21, 2014
1 parent 350eaf2 commit 276eded
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/main/java/hockeyapp/HockeyappRecorder.java
Expand Up @@ -132,10 +132,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
tempDir.delete();
tempDir.mkdirs();

FileSet fileSet = Util.createFileSet(new File(build.getWorkspace().getRemote()),
vars.expand(filePath), null);
// Take the first one that matches the pattern
File file = new File(fileSet.iterator().next().toString());
FilePath remoteWorkspace = new FilePath(launcher.getChannel(), build.getWorkspace().getRemote());
FilePath[] remoteFiles = remoteWorkspace.list(vars.expand(filePath));
File file = getFileLocally(remoteWorkspace,remoteFiles[0].getName(),tempDir);
listener.getLogger().println(file);

float fileSize = file.length();
Expand Down Expand Up @@ -187,10 +186,9 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher,
entity.addPart("ipa", fileBody);

if (dsymPath != null) {
FileSet dsymFileSet = Util.createFileSet(new File(build.getWorkspace().getRemote()),
vars.expand(dsymPath), null);
// Take the first one that matches the pattern
File dsymFile = new File(dsymFileSet.iterator().next().toString());
FilePath remoteDsymFiles[] = remoteWorkspace.list(vars.expand(dsymPath));
// Take the first one that matches the pattern
File dsymFile = getFileLocally(remoteWorkspace,remoteDsymFiles[0].getName(),tempDir);
listener.getLogger().println(dsymFile);
FileBody dsymFileBody = new FileBody(dsymFile);
entity.addPart("dsym", dsymFileBody);
Expand Down Expand Up @@ -314,7 +312,7 @@ private static File getFileLocally(FilePath workingDir, String strFile,
return file;
}

return new File(workingDir.getRemote(), strFile);
return new File(workingDir.getRemote(), strFile);
}

@Override
Expand Down

0 comments on commit 276eded

Please sign in to comment.