GithubHelp home page GithubHelp logo

buildpack-slug-cleaner's Introduction

Slug cleaner buildpack

This buildpack helps large applications get in under the Heroku size limit. It extends .slugignore to allow the ! prefix and repurposes it to mean "run after the build", preventing files from reaching the final slug. Add it to the end of your buildpacks list so it runs last:

$ heroku buildpacks:add https://github.com/stevo550/buildpack-slug-cleaner.git

Many apps might like to add this to their .slugignore file:

# Rails asset pipeline cache won't be touched in production
!tmp/cache
# App images should have been compiled into public/
!app/assets/images
# Known useless files and directories
!wkhtmltopdf-darwin-x86
!wkhtmltopdf-linux-x86

The easiest way to investigate slug sizes is to do a heroku run bash on the last passing build and du -hs * from there. Slug sizes are usually something that increase over time, so you might find something useful even off a successful build.

If you find any good suggestions for other languages and frameworks send in a pull request or issue and I'll add it to the above.

buildpack-slug-cleaner's People

Contributors

apatzer avatar kamui avatar nekopanic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

buildpack-slug-cleaner's Issues

** required?

I wonder what use this thing actually is. It does make things pretty complicated.

sed: couldn't flush stdout: Resource temporarily unavailable

It seems like when the directory it's removing is large (large tmp/cache or /node_modules), I end up with this sed error:

sed: couldn't flush stdout: Resource temporarily unavailable

Also, the verbose flag on rm is causing so much to be logged that when I try to view the deploy log on Heroku, Chrome exhausts my ram and I have to kill the tab.

Perhaps we can turn off the verbose or only pipe to sed on root directories for that slug ignore directory.

Syntax error in Heroku build log

Noticed the following in Heroku build log after adding buildpack-slug-cleaner to buildpacks:

-----> Slug cleaner buildpack app detected
/app/tmp/buildpacks/af2d83ae6592f0b44cba3ea6663183993cd1216fb49e34ffff4ca8928557c92236d4a9a29ca887242d5670e989ac04012ff3396bd26d1ba48eeac512885c01b7/export: line 7: unexpected EOF while looking for matching `"'
/app/tmp/buildpacks/af2d83ae6592f0b44cba3ea6663183993cd1216fb49e34ffff4ca8928557c92236d4a9a29ca887242d5670e989ac04012ff3396bd26d1ba48eeac512885c01b7/export: line 8: syntax error: unexpected end of file

Not sure how this is error is being generated or if it matters (the build succeeds).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.