Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku deploy a sub directory?

I'm trying to deploy a node app, but I'm running into a problem with how my code is structure. The app is git inited at the top level and it looks like:

App (git tracked in remote repo) - .git - server - client - plugin - extras 

Since Heroku needs me to push only the server directory directly with the package.json build file, I'm not sure how to setup my directory. I want it such that I can deploy heroku from the 'App/server' folder, but still git pull/push the entire app as I do now:

App (git tracked in remote repo) - .git - server (can run 'git push heroku master' for just this folder)   - .git (?) - client - plugin - extras 

How I can achieve this the simplest? I read about git-submodules, but that seems messy and I wanted to be sure. Thank you very much from a git nub.

like image 631
kaid Avatar asked Oct 07 '14 17:10

kaid


People also ask

Can a private repository be deployed to Heroku?

Heroku Button is no longer limited to source code hosted in public GitHub repos. It now works with both public and private GitHub repos. When used with private repos, a template URL parameter must be specified in the button URL and the Heroku user must be linked to a GitHub account that has access to the private repo.

Can I deploy front end on Heroku?

Each process has its own port in dev, but deploying on Heroku uses just one total. Put the working frontend in a subdirectory of root (such as /frontend ). Put the working backend in a subdirectory of root (such as /api -- the blogpost assumes the backend remains in the root directory -- either way is fine).


1 Answers

I think git-subtree should work:

git subtree push --prefix server heroku master

Additional resources:

  • How can I deploy/push only a subdirectory of my git repo to Heroku?
  • https://coderwall.com/p/ssxp5q
like image 200
rgbrgb Avatar answered Sep 23 '22 17:09

rgbrgb