This repository was archived by the owner on Oct 4, 2024. It is now read-only.
This repository was archived by the owner on Oct 4, 2024. It is now read-only.
Unix file permissions in zip files #24
Open
Description
In the process of moving a codepipeline from US to EU, I noticed an issue with the zip artifact created by the codepipeline plugin; it has no unix file permissions. Having used the codedeploy plugin in the past, I knew the artifacts it created did have unix file permissions.
I hacked together a version of the codepipeline plugin that uses the same method of creating the zip file as the codedeploy plugin, basically I've rewritten compressZipFile
to no longer use compressArchive
:
public static void compressZipFile(
final File temporaryZipFile,
final Path pathToCompress,
final BuildListener listener)
throws IOException {
try (
final FileOutputStream zipArchiveOutputStream = new FileOutputStream(temporaryZipFile);
) {
final FilePath sourceDirectory = new FilePath(pathToCompress.toFile());
try {
sourceDirectory.zip(
zipArchiveOutputStream,
new DirScanner.Glob("", "")
);
} catch(InterruptedException e) {
LoggingHelper.log(listener, "Error creating zip file: '%s'", e.toString());
throw new IOException(e.toString());
} finally {
zipArchiveOutputStream.close();
}
}
}
Been years since I last wrote any java, so this is probably not the best solution - but it will allow me to get on with the task at hand.
Metadata
Metadata
Assignees
Labels
No labels