-
Notifications
You must be signed in to change notification settings - Fork 4
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
attempting Heroku deployment #358
Conversation
$ heroku login ...note that everything is good until the rake npm and gulp commands :( I don't know where the app directory is on heroku |
wait...
w00t! need to amend this branch |
https://arcane-island-8296.herokuapp.com/ has no static assets to serve up atm, of course |
@MatthewVita The |
Heroku is designed for dynamic resources, not static ones. We should consider using a CDN for our static assets. Here's Heroku's docs on integrating with Amazon CloudFront. Over on Gratipay, we're using MaxCDN successfully for static assets. |
What's our current static setup? How do npm/gulp interact with the Rails asset pipeline, if at all? |
@whit537 I should be clear: gulp just "compiles" our frontend to the Rails "public" directory |
db:migrate, npm, and gulp should be run every push, yes |
Okay, and the |
yes, and so we can have frontend dependencies resolved (such as angular, jquery, etc) |
Resolved when/where? Per-request on the server side or something? |
60a9390
to
27aadb4
Compare
npm downloads the dependencies and gulp shoves them into the vendors.min.js and vendors.min.css files |
Looks like you're on the right track with https://devcenter.heroku.com/articles/getting-started-with-rails4#migrate-your-database |
Okay, so still only happening once per deploy. |
https://devcenter.heroku.com/articles/getting-started-with-rails4#webserver |
cool. Do you mind looking into that? I'm currently fighting with getting rake task to run correctly (almost there...) |
btw, WebBrick is currently what's being used, which is not good |
damnit. Heroku has node installed by default but not npm... |
Sure thing! :-) |
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v83 hmmmm |
27aadb4
to
aa063ec
Compare
nope :( |
I've achieved parity with #358 (comment): |
/me trying to figure out how to install npm with buildpacks and failing miserably lol |
@MatthewVita Not sure how you're approaching it, but you should only have one buildpack per application. Either we use Heroku's official Rails buildpack, or their official Node.js one, or we roll our own that combines the two. Seems like we should be able to find a way to install |
38531eb
to
682182c
Compare
Alright @dmtroyer @MatthewVita, ready for review! :-) |
I'm reviewing local dev deployment ... |
Only assume `bundle` on `PATH` (not `gulp` or `rails`), and adapt to `gulpfile.js` now being in the project root.
I think there are some other changes we should make to local dev deployment, but they're out of scope for this PR. Reticketed as #360. |
This PR breaks the scripts in |
Hmm ... I ran |
I think I'm gonna consider that good enough for this PR. S'okay, @MatthewVita? |
fc8cfb2
to
485a299
Compare
@whit537 thanks for your patience and great work.
Just tried it on a fresh EC2 instance and the following worked: ubuntu@ip-172-31-34-97:~/cityasacampus/dev/src$ rails s & sleep 3 && wget localhost:3000 && cat index.html #spits out HTML
ubuntu@ip-172-31-34-97:~/cityasacampus/dev/src$ rails s & sleep 3 && wget localhost:3000/topics.json && cat topics.json #spits out JSON from GET endpoint I'm going to merge now. My only comment was on how you did the comments in I also ripped out the old rake tasks here: hhttps://github.com/saxifrage/cityasacampus/commit/485a2996588d5329a4acb770b9dab0eaae6d6b37 |
wfm
Woo-hoo! Thank you! :-D |
@whit537 starting out here.
Going to set up a fresh heroku box and try these rake tasks. I'm not sure if doing the steps through rake tasks is the most elegant approach, tbh.