Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-34122] Exclude output file from itself #19

Closed
wants to merge 5 commits into from

Conversation

jtnord
Copy link
Member

@jtnord jtnord commented Oct 13, 2016

JENKINS-34122 Using configured value from the step, rather than the FilePath to exclude is from the FileSet

This also fixes the unit tests so that they pass when run on windows.

@reviewbybees
obsoletes #18, and satisfies my commitment to a better fix without introducing the regression I identified.

@ghost
Copy link

ghost commented Oct 13, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@rsandell
Copy link
Member

this looks ok, except for all the println

Copy link
Member

@batmat batmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 mostly OK, as I don't know if using System.out.println might be something specific here with unavailable/unusable loggers or something.

@@ -120,12 +120,23 @@ public ZipItFileCallable(FilePath zipFile, String glob) {

@Override
public Integer invoke(File dir, VirtualChannel channel) throws IOException, InterruptedException {
String canonicalZip = new File(zipFile.getRemote()).getCanonicalPath();
System.out.println("zipFileRemote is: " + zipFile.getRemote());
System.out.println("canonicalZip is: " + canonicalZip);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this normal to sysout instead of logging?

archiver.visit(new File(dir, path), path);
File toArchive = new File(dir, path).getCanonicalFile();
if (toArchive.getPath().equals(canonicalZip)) {
System.out.println("Not archiving " + toArchive + " as this is the output zip itself");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

System.out.println("Not archiving " + toArchive + " as this is the output zip itself");
}
else {
System.out.println("archiving " + toArchive + " as this is not excluded");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

ZipInputStream zip = new ZipInputStream(file.open());
ZipEntry entry = zip.getNextEntry();
while (entry != null && !entry.getName().equals("output.zip")) {
System.out.println("zip entry name is: " + entry.getName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can live with it in a test, though I don't like it much.

@rsandell
Copy link
Member

Created #21 fixing merge conflicts and removed debug prints

@rsandell rsandell closed this Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants