[英]How do I create a TFS 2017 CI/CD pipeline for an angular 7 app
Is it possible to create a CI/CD pipeline for an Angular 7 app using an on premise install of TFS 2017? 是否可以使用本地安装的TFS 2017为Angular 7应用程序创建CI / CD管道?
I have done this on the cloud based VSTS and DevOps using the npm templates but these build tasks don't seem to be available on TFS 2017. 我已经使用npm模板在基于云的VSTS和DevOps上完成了此操作,但是这些构建任务似乎在TFS 2017上不可用。
I was thinking of creating a power shell script and running it as a build task but I have read issues with this method such as having to install the Angular CLI each time you build and problems with install locations on the build server. 我当时正在考虑创建Power Shell脚本并将其作为构建任务运行,但是我已经阅读了此方法的问题,例如每次构建时都必须安装Angular CLI,以及构建服务器上的安装位置问题。
I cannot upgrade the build server to use DevOps but I can install nodejs and anything else which may be required. 我无法升级构建服务器以使用DevOps,但可以安装Node.js以及可能需要的其他任何工具。
What I want to do is to build the angular code on checking, run the unit tests and deploy to another server if all is successful. 我要做的是在检查时构建角度代码,运行单元测试,如果一切成功,则将其部署到另一台服务器。
You could take a look at this detail tutorial here-- Angular 7 with Azure DevOps Build Pipeline 您可以在此处查看此详细教程- 带有Azure DevOps构建管道的Angular 7
Even though it's using YAML, it should be the same result if you are using visual UI in TFS/Azure DevOps Server. 即使使用的是YAML,但如果在TFS / Azure DevOps Server中使用可视化UI,则结果应相同。
It's just using npm command to run the build, kind of npm run pro-build-dev
. 它只是使用npm命令来运行构建,而
npm run pro-build-dev
。
If there is no such npm task in your TFS2017 server, you could try to download it from opensource GitHub Reop-- azure-pipelines-tasks . 如果您的TFS2017服务器中没有此类npm任务,则可以尝试从开源GitHub Reop -azure-pipelines-tasks下载它。 Or build your own task to involve the npm command line by referring the source code.
或通过引用源代码来构建涉及npm命令行的任务。
For build agent environment, you just need to make sure it's the same as your local environment. 对于构建代理环境,您只需要确保它与本地环境相同即可。 If you are fine to build your angular 7 app in your local develop machine.
如果您可以在本地开发机器上构建angular 7应用程序,则可以。 You should also be able to build it without any environment issue on your build agent.
您还应该能够在构建代理上没有任何环境问题的情况下进行构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.