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

Preserve file permissions and support include / exclude filters for "Use Jenkins source" #127

Merged
merged 7 commits into from
Jun 24, 2022

Conversation

ikedam
Copy link
Contributor

@ikedam ikedam commented Jun 5, 2022

Issue #, if available:

#125, #126

Description of changes:

Improvements for "Use Jenkins source"

  • Preserve file permissions, especially execution bits. This makes it easy to run jobs using script files on CodeBuild.
    • Used ArchiverFactory Jenkins core provides as JDK's implementation doesn't handle file permissions.
  • Support include / exclude filters. This allows exclude files like '.git/**' from the zip source.
    • Used Apache Ant directory scanner.
    • It requires users to write ant file patterns but I believe it's not so difficult for Jenkins users as ant file patters are often used in Jenkins plugins.

mvn install has passed in my environment (maven:3.8.1-jdk-8 docker container).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

<f:entry title="Exclusion pattern (optional)" field="workspaceExcludes" help="/plugin/aws-codebuild/help-workspaceExcludes.html">
<f:textbox />
</f:entry>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will look like this:
image

@ikedam ikedam changed the title Feature/125 use archiver Preserve file permissions and support include / exclude filters for "Use Jenkins source" Jun 5, 2022
@leoherran-aws leoherran-aws merged commit 3fbfde2 into awslabs:master Jun 24, 2022
@leoherran-aws
Copy link
Collaborator

Merged, thanks for your contribution!

leoherran-aws added a commit to jenkinsci/aws-codebuild-plugin that referenced this pull request Jun 27, 2022
…Use Jenkins source" (awslabs#127)

* [JENKINS-67853] Add a test to reproduce JENKINS-67853

* [JENKINS-67853] Use Archiver to creaete zip file

* Preserves file modes.
* Also preparation for includes/excludes feature.

* [JENKINS-67853] Use the new archiving method instead of `ZipSourceCallable.zipSource` in tests

* [JENKINS-67853] Archive directories explicitly to allow empty directories

* [JENKINS-67854] Add workspaceInclude / workspaceExclude feature

* [JENKINS-67854] Add test for workspaceIncludes/workspaceExcludes

Co-authored-by: Leo Herran <[email protected]>
@leoherran-aws
Copy link
Collaborator

This has been released in version 0.57, which should be available in a couple of hours.

@ikedam
Copy link
Contributor Author

ikedam commented Jun 28, 2022

Thanks, 0.57 worked perfectly.

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.

2 participants