awslabs / aws-codedeploy-plugin

Jenkins plugin for AWS CodeDeploy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zip does not include all dirs

alexfd opened this issue · comments

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.

Any help debugging this is appreciated.

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.

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.

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

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?

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

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...