What’s that? It’s time for another Deployment tutorial! The last three (trip planner, twitter.js and wikistack) went pretty well but here we have another challenge - seed media files on top of simply seeding a PostgreSQL database!
So the core instructions are sited at the wikistack tutorial. Do not push to heroku until i tell you to. Here I will focus on the incremental difference.
- to configure
process.env.DATABASE_URL, go to
server/db/db.jsand add it in there alongside
pgdependency is gone
- remember to create a table in SQL. this time, call it
juke. refer to the wikistack tutorial for instructions
- ok so it gets tricky from here! We aren’t going to use webpack to rebuild the app on heroku so we need
public/bundle.jsto be served. delete that and
.gitignoreso you will be able to push it to heroku. you may want to do this in a different branch (
git checkout -b herokubranch) so you still have the right gitignore for github, but i didn’t bother. (nothing secret in
- remove the
package.json. you’ll seed your database manually…
- Time to push to heroku!
git add . && git commit -m "heroku deploy". MAKE SURE BUNDLE.JS is ADDED!! and now when you push here the difference is you are pushing a specific BRANCH instead of master. However, heroku only runs master. how to do that?
git push heroku <YOURBRANCHNAME>:master.
- ok hopefully that went well. to seed the db,
heroku run node ./bin/seed
contact me @swyx on twitter if you run into any issues. My app is deployed here https://swyx-juke.herokuapp.com/#/