Frage

I need to separate my Frontend and Backend into two different repos. Because one developer can't install rails and doesn't need it (we can make stub for API).

How can I do it in case of deployment? Do I need git submodule? How to use it (with GitHub and Ninefold)?

I found information about how to develop standalone frontend app (thanks I can use grunt) and how to use submodules, but I can't combine it. Please help! Does anyone have such experience?

War es hilfreich?

Lösung

Having your rails app provide a RESTful API is a good idea here. Your standalone front-end app can then interact with the API over HTTP(S).

If you want the front-end app within the rails app but need repository separation (i.e. don't want the front-end developer to access the code of the rails app), using a git submodule may work but probably needs some organisational thought.

This is what I'd do:

  • First clone your rails app from GitHub or Bitbucket (or git init one locally) and then configure a git submodule.

    • git clone git@github.com:pathto/myawesomerailsapp.git
    • cd myawesomerailsapp
    • git submodule add git@github.com:pathto/mystandalonejsapp.git app/assets/standalone
  • Now when you cat .gitmodules you'll notice there's a new submodule configured in your repo.

Commit and push your changes. Ninefold will detect the submodules and use them, but if you have any problems just get in touch.

Good luck!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top