Deploying An Angular application using continuous integration from git or gitLab

别来无恙 提交于 2019-12-03 17:32:37

If you are using angular cli to building the application, then its pretty straight forward to do the same via jenkins/teamcity.

Install node js on jenkins - https://wiki.jenkins.io/display/JENKINS/NodeJS+Plugin Further you can follow this blog - https://blog.couchbase.com/create-continuous-deployment-pipeline-nodejs-jenkins/

Specific to angular 2/4/5 -You just need to pass the angular CLI commands via shell script and push the build generated towards the desired server.

Something like - ng build With that you can use following flags as well 1. '--prod' - reduces the build size considerably, as it eliminates dead code while using tree shaking 2. '--build-optimizer' - it performs further code optimization, e.g removing decorators etc (works with angular 5, CLI 1.5)

Command will look something like - ng build --prod --build-optimizer

For more in-depth you can read wiki - https://github.com/angular/angular-cli/wiki/build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!