jets icon indicating copy to clipboard operation
jets copied to clipboard

Deploy hooks

Open thepry opened this issue 6 years ago • 2 comments

Summary

Would be nice if there was a way to add a hook to .jets/deploy/hooks.rb (for Rails mode) or similar and get the executed after the project was copied to /tmp/jets/turbo-wrapper-project

Motivation

This is the easiest way to allow users customise the deploy process. If some files should be removed from public directory or Gemfile needs to be modified before the deploy. (In my case gems take too much space, but some of them can be removed, since they are not going to be used in Lambda)

Guide-level explanation

  • User can add ruby code in .jets/deploy/hook.rb that gets executed after the project is copied to tmp directory, but before the rest of deploy happens.

Reference-level explanation

TBD

Drawbacks

This feature will be rarely used.

Unresolved Questions

TBD


@tongueroo I can implement this if you support the idea.

thepry avatar Jan 07 '19 18:01 thepry

Thanks so much for considering contributing to Jets. 😁

Yes, have thought about deploy hooks. Would like to spend some time thinking about the details more.

RE: In my case gems take too much space, but some of them can be removed, since they are not going to be used in Lambda

For your specific issue. I just released a fix that removes .git directories from the vendor/gems. That might make a difference for you.

Also, wondering if you've considered just removing the gems from Gemfile or only add them to the development group. Jets does not bundle gems in the test or development group. This might help reduce the package size down.

Have held off on exploring some ideas to reduce size. But have held off working on it because think AWS will eventually increase the code size limit. 🤔

tongueroo avatar Jan 11 '19 01:01 tongueroo

Also, wondering if you've considered just removing the gems from Gemfile or only add them to the development group. Jets does not bundle gems in the test or development group. This might help reduce the package size down.

yeah, actually I ended up with writing a rake script that copies project to /tmp/project directory, removes some gems from Gemfile and some files from public folder.

thepry avatar Jan 11 '19 14:01 thepry