angular - 在 Azure 中部署 Angular 应用程序并使用 VSTS 配置 CI/CD

标签 angular azure azure-devops azure-pipelines azure-deployment

我正在学习在 Azure 中部署 Angular 应用并使用 VSTS 配置 CI/CD。

所以,我基于 this 创建了 AngularHeroes 应用程序教程。

在 Azure 中创建了新资源(Web 应用服务)。

在 VSTS 中,创建一个新项目,添加 VSTS 存储库并将其克隆到本地以推送 Angular 应用程序代码。为了设置 CI/CD,我遵循了 this msdn文章。并对构建定义进行排队,但它失败并出现以下错误:“npm 失败,返回代码 4294963238”。 所以,我检查了this git文章。

此外,我还使用此 VSTS 项目配置了 azure 应用程序的部署选项。 并将代码从本地推送到 VSTS 存储库并尝试再次运行构建,但出现相同的错误。

所以,我陷入困境并找出缺失的部分。请让我知道这里出了什么问题...

我还附上了配置Publish artifacts的屏幕截图, Build definitonRelease definition ,更多地了解配置。

最佳答案

1)在VSTS上创建帐户并创建项目

enter image description here

2) 如果您在 VSTS 上有代码,请添加代码

enter image description here

3) 转到“构建”选项卡并单击“构建”

4)现在创建管道

4.1) 点击构建并创建构建管道

enter image description here

4.2) 从代码源列表中添加 bitbucket 或任何其他版本控制

enter image description here

4.3 ) 选择 npm 并添加以下命令

enter image description here

4.4) 选择另一个 npm 并添加以下命令

enter image description here

4.5) 现在选择命令行并添加以下命令

enter image description here

4.6) 创建另一个 npm 和以下命令

enter image description here

4.7) 多一个 npm 并添加以下命令 enter image description here

4.8)选择Azure App Service Deploy并添加以下命令

enter image description here

4.9)最后步骤

enter image description here

5)点击保存并排队,将显示结果,您也可以配置电子邮件通知

enter image description here

关于angular - 在 Azure 中部署 Angular 应用程序并使用 VSTS 配置 CI/CD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51219295/

相关文章:

azure - PowerShell 安装模块命令在 Azure DevOps Pipeline 中失败

Azure Cosmos DB 移动到另一个订阅

azure-devops - 如何正确续订我的 PAT,以便我的部署组不会因 PAT 到期而停止工作?

Angular 子路线不起作用

angular - 在 App.modules.ts 中注册的模块在其他模块中不可用

angular - 像 AngularJS 中的作用域注入(inject),用于更现代的库

azure-devops - 备份/恢复 AzureDevOps

angular - Angular 4中模型对象的Getter和Setter

Azure APIM 限制所有 IP 地址

azure - 如何在不停止虚拟机的情况下更改虚拟机公共(public)IP地址