I have a lengthy discussion with a colleague about how we should deploy our angular 4 app to production server.
Would like practical advise and guide on this issue from the community, if possible.
Premise 1
At production server,
git pull
npm install
{set up production configuration}
ng build --prod --aot
Premise 2
At production server,
git pull
The best way to do it, is to build and compile in the local development Workstation, and deploy only the output of the build.
The git repo master branch needs to contain the source code not the only compiled&built one.
You can deploy in the production server using other method rather then the git pull command but if you insist on using it, you can init a new repo in the /build file and pull this repo to the production server.
If you really can't afford the build farm yet and if it enables the testing or other activites, yeah sure. Test the workflow you describe and see it for yourself, but it's definitely not a good long term practice.
If eventually you're gonna use the CI in your workflow, I would suggest to just start trying to set it up instead of wasting time/money setting up something temporary. Moreover, 5 minutes isn't a big deal trust me.
As a side note: If you would have spent time trying your suggestion instead of writing your SO question and talking with your colleague, you probably would already have figured out the answer yourself.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.