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

zip does not include all dirs #77

Open
alexfd opened this issue Dec 12, 2017 · 7 comments
Open

zip does not include all dirs #77

alexfd opened this issue Dec 12, 2017 · 7 comments
Labels

Comments

@alexfd
Copy link

alexfd commented Dec 12, 2017

I have the following config which won't include some directories in the zip file, even though I don't use any excludes.
in the workspace directory I can see that these ones exist, but once the archive is built and transferred to s3, they don't anymore.
Config attached:
2017-12-12 21_33_20

The dirs are:
storage
bootstrap/cache
There might be more, but who knows. This is very weird.

@alexfd
Copy link
Author

alexfd commented Dec 13, 2017

Any help debugging this is appreciated.

@alexfd
Copy link
Author

alexfd commented Dec 13, 2017

Ok so the missing dirs list is actually bigger than that, I have around 20 dirs that are being ignored.
All of them have one thing in common: they are empty dirs.
This is a major bug since the application will not run if said dirs are not existing.

@Jmcfar Jmcfar added the bug label Dec 19, 2017
@Jmcfar
Copy link
Contributor

Jmcfar commented Dec 19, 2017

This appears to be a bug in the way DirScanner.Glob handles what to include/exclude out of the archive:
https://github.com/awslabs/aws-codedeploy-plugin/blob/master/src/main/java/com/amazonaws/codedeploy/AWSCodeDeployPublisher.java#L360 (based on a similar issue in another Jenkins plugin - jenkinsci/jenkins-clone-workspace-scm-plugin#12)

One workaround here for you until we can get the behavior fixed that might be possible if these folders are not needed at build time and only needed at deploy / runtime would be to have a AfterInstall script that creates the empty directories. However, I agree we should fix this within the plugin itself.

@alexfd
Copy link
Author

alexfd commented Dec 19, 2017

Thanks for the reply @Jmcfar, that's exactly what I ended up doing, creating the dirs in AfterInstall.

@alexfd alexfd changed the title zip does not include all files zip does not include all dirs Dec 19, 2017
@kirsley
Copy link

kirsley commented Feb 11, 2019

we have similar issue, we generate a cache before deploying that code and some of the folders get created empty cause we just need them to exist, but they don't get in the zip file.
Was any solution found other than creating them again in AfterInstall hook?

@alexfd
Copy link
Author

alexfd commented Feb 12, 2019

@kirsley sorry but no, it worked for me using the workaround and I left it like that.

@mmehmet
Copy link

mmehmet commented Jan 17, 2020

I know this is from 2017 but we just experienced this issue in 2020

apart from the (less than ideal) solution of making an AfterInstall script recreate all the directories, we have also implemented an additional workaround - dropping a ".gitkeep" file into each directory (which is not ignored by git) and thus making them NOT empty - just containing an empty file

preferably, this bug would be fixed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants