Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

write a custom buildpack #1257

Closed
chadwhitacre opened this issue Jul 29, 2013 · 6 comments
Closed

write a custom buildpack #1257

chadwhitacre opened this issue Jul 29, 2013 · 6 comments

Comments

@chadwhitacre
Copy link
Contributor

We want to install sass on Heroku as part of #1245. We should write a custom buildpack for this. This seems like a good idea in general because the generic Python buildpack does a lot more than we need it to, adding time and complexity to our deploy process (#985). Let's bring that under control for master as it stands today and then we can add sass to it on #1245.

This was referenced Jul 29, 2013
@chadwhitacre
Copy link
Contributor Author

I'm scrapping this approach. I was hoping we could use the same build system we use locally (i.e., make build) but it's not that straightforward, because making a virtualenv fixes a directory name that is temporary. Once Heroku builds the app in the temporary location it tars it up and unpackages it elsewhere (once per dyno). There's a (somewhat beta) --relocatable option to virtualenv, and of course we could iterate further in the direction of heroku-buildpack-python, which doesn't use a virtualenv at all. But then @btubbs pointed out the {pre,post}_compile hooks that are available and that turns out to be a much easier way to install sass, which is the actual goal here.

@patcon
Copy link
Contributor

patcon commented Mar 5, 2014

Python-newbie question: Can we ditch the virtualenv jazz if we use vagrant? Does virtualenv not play nice with heroku?

@btubbs
Copy link
Contributor

btubbs commented Mar 6, 2014

The Heroku buildpack uses virtualenv to build the environment that you're deployed into. Using it locally makes your environment closer to production. It also lets you install packages as an unprivileged user instead of needing to be root.

@patcon
Copy link
Contributor

patcon commented Mar 6, 2014

Ah ok, I think I saw this way back when first looking into how python works, and thought it was no longer being used on heroku :)
https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L119-L123

But would it be more consistent if we somehow ran the heroku-buildpack-python locally in vagrant? Is that something people do?

@btubbs
Copy link
Contributor

btubbs commented Mar 6, 2014

It's not normal for people to do that, because the Heroku buildpack is hardcoded to run your application at /app in the filesystem, which isn't a particularly developer-friendly directory.

@patcon
Copy link
Contributor

patcon commented Mar 6, 2014

@btubbs Worst case scenario, we could create /etc/profile.d/login-dir.sh so that vagrant ssh cd's you right there. Or am I misunderstanding? I mean, there might be plenty of good reasons not to try to run a buildpack via vagrant, but not sure if /app should be it :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants