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

Add support for storing stats file in staticstorage #32

Closed
wants to merge 2 commits into from

Conversation

shezadkhan137
Copy link

This is a small feature which allows the stats file to be able to be stored in the staticstorage. This is useful for when your static storage is non local (we use S3 with the django storages lib) it allows multiple webservers to access the same stats file.

@owais
Copy link
Collaborator

owais commented Jan 1, 2016

@shezadkhan137 Most people (including me), check-in the stats file to source control system or add it to the final build before deploying along with new python code.

@owais
Copy link
Collaborator

owais commented Jan 1, 2016

Closing for now. Please re-open if the above solution doesn't work for you.

@owais owais closed this Jan 1, 2016
@jpulec
Copy link

jpulec commented Apr 27, 2016

Is there a way you'd consider some sort of proposal for storing the stats file in staticfiles?

Currently, I don't check my stats file into source control. We're working towards continuous deployment, so manually adding and committing my stats file isn't really an option.

Additionally, we're deployed on heroku, and since it is ephemeral we can't just generate a stats file in a post deploy script. This pretty much leaves staticfiles as our best option.

@ryanhiebert
Copy link

I also run on Heroku, and I'll share my setup. I use both the heroku/nodejs buildpack and the heroku/python buildpack, in that order. webpack-bundle-tracker is installed and configured for production, so when Heroku runs npm install in the buildpack my postinstall script in package.json runs webpack -p --config webpack.prod.config.js, which generates the stats file, which is in turn included in the slug.

I hope that clarifies things. I agree with others that, at least for Heroku, keeping it outside static files makes a lot of sense. It's certainly what I prefer.

@jpulec
Copy link

jpulec commented Apr 27, 2016

@ryanhiebert Ah. A postinstall script that runs in the same dyno. Excellent. Thanks for the awesome idea!

@ryanhiebert
Copy link

No problem. You'll find it absolutely critical for building bundles as late as possible (don't include build artifacts in the repository), which enables neat stuff like using babel-loader for using ES6. Lots of good stuff.

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.

None yet

4 participants