Skip to content
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
@Telling

Description

@Telling

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions