Skip to content

exclude build directory from zip - #87

Closed
fridaystreet wants to merge 1 commit into
motdotla:masterfrom
fridaystreet:master
Closed

exclude build directory from zip#87
fridaystreet wants to merge 1 commit into
motdotla:masterfrom
fridaystreet:master

Conversation

@fridaystreet

Copy link
Copy Markdown

currently running package with no build directory argument creates build directory and zips in the application directory. When running subsequent builds the zip files include the previous build files which causes them to grow infinitely with each package run.

added -x build to command line for zip to exclude from packaging

currently running package with no build directory argument creates build directory and zips in the application directory. When running subsequent builds the zip files include the previous build files which causes them to grow infinitely with each package run.

added -x \*build\* to command line for zip to exclude from packaging
@DeviaVir

Copy link
Copy Markdown
Collaborator

Hi @fridaystreet, interesting problem. I think the way you've added the exclude on the zipNative command is incomplete, since there's a _zip as well.

However, since codeDirectory is a new temp dir, and we clean up this directory before a deploy:
https://github.com/fridaystreet/node-lambda/blob/master/lib/main.js#L247
It might make more sense to run this cleanDirectory before each run.

What are your thoughts on the above?

@fridaystreet

Copy link
Copy Markdown
Author

Hi @DeviaVir,

Yeah sorry I realised there was the windows stuff in there too. I work on linux and don't have a windows box/vm to hand to workout / test the command arguments. Thought I'd just post it up and gauge the appetite before putting too much effort in.

Yeah sure the cleandirectory approach sounds like the go. I haven't really dug in to the code much more than the zip section.

Is this what you're referring too? https://github.com/fridaystreet/node-lambda/blob/master/lib/main.js#L141

I did try adding 'build' in to that array, but it didn't seem to do anything.

If you can provide a bit of direction on fixing it via the cleanDirectory, I'd be happy to build and test it then update the PR

Cheers

@DeviaVir

Copy link
Copy Markdown
Collaborator

@fridaystreet sure thing, I'm already insanely happy you want to help solve bugs!

So in the _archive, before it does anything it first runs clean:
https://github.com/fridaystreet/node-lambda/blob/master/lib/main.js#L340

The _archive is called in .package and .deploy so if anywhere, I think we should solve it there. The excludes in _rsync does seem like the right place to put it, though. I'll do some testing as well.

@fridaystreet

Copy link
Copy Markdown
Author

@DeviaVir sure no worries. It's a super useful tool and exactly what I was looking for. It's saved me so much time and it's now going to be used to deploy our lambda functions in production. So more than happy to contribute where I can.

OK I'll have a look over the weekend. I did run in to another issue which I ended up just putting in a hacky workaround so I could move forward, but I'll raise that as an issue and we can work through it separately. I've also got a few extra requirements around the lambda configuration capabilities, so anything I build I'll submit too.

Cheers

DeviaVir pushed a commit to DeviaVir/node-lambda that referenced this pull request Apr 22, 2016
@DeviaVir DeviaVir mentioned this pull request Apr 22, 2016
@DeviaVir

Copy link
Copy Markdown
Collaborator

@fridaystreet I looked into it more, and landed on #91, let me know if that also fixes it for you!

@DeviaVir DeviaVir closed this in 1e97000 Apr 22, 2016
@fridaystreet

Copy link
Copy Markdown
Author

Sorry haven't had a chance to test, but looks like it should do the job. I guess I was missing the / when I tested it.

Thanks for jumping on this so quickly.

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