angularjs - Continuous Integration/Deployment - MEAN Stack Project based on 2 Git Repositories -
i starting new project using mean stack. front-end , back-end in 2 different git repositories, hosted on bitbucket. each project/repo has own unit/e2e tests. backend restful json api , front-end angularjs spa. grunt task available in front-end project output optimised/minified version of client code.
my idea first run unit/e2e tests on client's code, "grunt deploy" task, somehow automatically commit result of grunt task backend project/git repo, run unit test of backend code , deploy backend project on amazon.
i not sure how setup kind of project on platforms travis or codeship it's using 2 git repo instead of one...
if has experience/recommendation setup one, appreciated.
cheers,
niko
avoid hand-crafted solutions as possible, e.g. copying/committing files across repositories - lead pain , maintenance nightmare. use standard tool this.
the standard way of handling dependencies these using dependency management tool. on backend, typically using npm, familiar - you're using pulling in build tools grunt.
when building front end applications, typically use bower.
with bower, define bower.json
file , list dependencies there. in case, need bower.json
file in both projects:
- in front-end project,
bower.json
file defines name of package, version, important files, etc. - in back-end project,
bower.json
file defines dependencies, i.e. front-end project.
when defining dependency front-end project, can either point publicly available package bower registry (e.g. angular), or git repo (which you're looking for). can point git tag (e.g. #1.2.3
), or git branch (e.g. #master
). don't need register package in public bower registry if don't want to.
you need include bower install
additional build step in back-end project, ideally after running npm install
.
again, try avoid workarounds, try stick standard tools. splitting work 2 separate git repos fine, it's practice keeping project size manageable - need use right tools things done.
here tutorial links getting started bower:
Comments
Post a Comment