问题
I am using TeamCity for CI and build for my Angular App. As of now i have configured the project such that On each commit the build is triggering and generating the package successfully. Now i have requirement that on each successful build, the generated build package should get deployed on a server(we call it artifacts(e.g: https://serverurl.com). Can anybody please guide how to configure my project to achieve this?
回答1:
TeamCity contains an integrated lightweight builds artifact repository. Since TeamCity 2017.1 it is possible to add an external storage for TeamCity artifacts.
- Create Build configuration which build your project and got some application for install. (E.g.
ng build
) - publish all needed files to TeamCity ( General Settings -> Artifact paths: )
- Create Deploy configuration for install your app.
a. install on the system, where teamcity-agent is located b. install to another system via ssh or etc. - Add artifact and snapshot dependencies. The Build Configuration Settings | Dependencies page, Artifact Dependencies section allows configuring the dependencies. More here
Now you can get build artifacts for install. And when you run Deploy configuration, you able to select commit or specific dependence.
Look at Snapshot dependency parameters. You have to select Do not run new build if there is a suitable one and Only use successful builds from suitable ones, then when your build was failed, then deploy will not run
来源:https://stackoverflow.com/questions/48639738/how-to-deploy-angular-4-app-using-teamcity