标签: azure-pipelines

如何在 DevOps/VSTS 中自动启动之前成功的版本

如果当前版本失败了,如何自动运行之前成功的版本?

在此输入图像描述

例如:如果A(当前版本)失败,则自动触发B(先前成功版本)版本。从另一个发布定义触发。

devops azure-devops azure-pipelines devops-services azure-devops-extensions

2
推荐指数
1
解决办法
1298
查看次数

解释 - 通过 Microsoft Azure DevOps Pipelines 部署生产 NextJS 应用程序时出现的问题

通过 Azure DevOps Pipelines 将 NextJS 应用程序部署到 Microsoft Azure WebApp 服务时遇到问题?

问题可能有所不同,从Error: Cannot find module '../build/output/log' on next start整个管道故障到全部管道故障。

我需要一个吗server.js?我的package.json脚本应该是什么样子?对于这个用例来说,正确的管道设置是什么样的?

解决方案很简单,您可以在下面找到它:

azure azure-devops azure-pipelines next.js

2
推荐指数
1
解决办法
2301
查看次数

Azure DevOps/Pipeline IP 随机变化,因此由于防火墙规则,我无法使用 Azure SQL 数据库

Azure DevOps/Pipeline IP 随机变化,因此由于防火墙规则,我无法使用 Azure SQL 数据库。

这种情况下的解决办法是什么?

azure azure-sql-database azure-devops azure-pipelines azure-pipelines-release-pipeline

2
推荐指数
1
解决办法
2789
查看次数

Azure Devops - Terraform 任务失败并出现错误:无效的后端配置参数

我想在我的 azure Devops 管道上运行 terraform。我正在使用 MicrosoftDevLabs 市场上的 terraform 扩展版本 0.1.8\n我的任务如下所示:

\n
task: TerraformTaskV1@0\ndisplayName: 'Terraform - Init'\ninputs:\nprovider: 'azurerm'\ncommand: 'init'\ncommandOptions: '-input=false'\nbackendServiceArm: 'service-connection'\nbackendAzureRmResourceGroupName: 'Project-RG'\nbackendAzureRmStorageAccountName: 'projectsa'\nbackendAzureRmContainerName: 'tfstate'\nbackendAzureRmKey: 'terraform.tfstate'\nworkingDirectory: terraform\n
Run Code Online (Sandbox Code Playgroud)\n

它尝试执行的命令是

\n
`/opt/hostedtoolcache/terraform/0.13.5/x64/terraform init -backend-config=storage_account_name=projectsa -backend-config=container_name=tfstate -backend-config=key=terraform.tfstate -backend-config=resource_group_name=Project-RG -backend-config=arm_subscription_id=xxxx-xxxx-xxxx -backend-config=arm_tenant_id=*** -backend-config=arm_client_id=*** -backend-config=arm_client_secret=***\xe2\x80\x99\n
Run Code Online (Sandbox Code Playgroud)\n

错误消息是:

\n
Initializing the backend...  \nError: Invalid backend configuration argument\nThe backend configuration argument "storage_account_name" given on the command line is not expected for the selected backend type.   \nError: Invalid backend configuration argument  \nThe backend configuration argument "container_name" given on the command …
Run Code Online (Sandbox Code Playgroud)

terraform azure-devops azure-pipelines

2
推荐指数
2
解决办法
8225
查看次数

在 Azure DevOps 管道中,如何使用从 addSpnToEnvironment 参数返回的服务原理详细信息登录到 AZ CLI?

我本质上必须运行一个 Python 脚本,该脚本将 AZ CLI 命令嵌入到脚本中,并从模​​块中生成为进程subprocess。为了运行这些命令,我​​需要登录到 AZ CLI。

我的管道中有一个 AZ CLI 任务,其中的设置为addSpnToEnvironment = true 我提供了$env:servicePrincipalId,$env:servicePrincipalKey$env:tenantId。我的问题是,现在如何使用这些详细信息登录到 AZ CLI,以便在任务中维护上下文,并且我的 Python 脚本中的 AZ CLI 命令可以识别这一点并可以执行?

azure devops azure-devops azure-pipelines azure-service-principal

2
推荐指数
1
解决办法
5155
查看次数

在 Azure 管道中,如何设置 X 显示以进行无头 Chrome 测试?

在我们的 Azure Pipeline 中,我们尝试使用以下任务在 Angular 9 应用程序中运行端到端测试...

在此输入图像描述

package.json 定义了这个...

  "scripts": {
    ...
    "e2e": "npm run install-puppeteer && ng e2e"
  },
Run Code Online (Sandbox Code Playgroud)

但是当代理运行上述任务时,它会因“无法打开 X 显示”错误而终止......

> npm run install-puppeteer && ng test "--watch=false" "--codeCoverage=true" 





> thermo-protect-ui@0.0.0 install-puppeteer /home/vsts/work/1/s 

> cd node_modules/puppeteer && npm run install 





> puppeteer@5.5.0 install /home/vsts/work/1/s/node_modules/puppeteer 

> node install.js 



Chromium is already in /home/vsts/work/1/s/node_modules/puppeteer/.local-chromium/linux-818858; skipping download. 

08 12 2020 18:54:56.858:INFO [karma-server]: Karma v4.4.1 server started at http://0.0.0.0:9876/ 

08 12 2020 18:54:56.863:INFO [launcher]: Launching browsers Chrome with concurrency unlimited 

08 …
Run Code Online (Sandbox Code Playgroud)

google-chrome headless azure xvfb azure-pipelines

2
推荐指数
1
解决办法
2229
查看次数

循环访问 Azure Pipelines 变量组中的变量

azure-pipelines.yml文件中,如何枚举在 UI 中创建的“变量组”中定义的所有变量?

变量组

我想这样做,以便我可以.env在管道构建阶段将这些变量写入文件。

yaml azure-devops azure-pipelines

2
推荐指数
1
解决办法
5210
查看次数

Azure Pipelines 计划每月仅运行几天

有没有办法在 Azure 中自定义管道调度选项,使其仅在每月的第二周运行?

我知道您可以安排它在一周中的个别日子运行,但我不知道如何按月执行此操作。

cron azure-devops azure-pipelines

2
推荐指数
1
解决办法
8639
查看次数

在 Azure Pipelines 中,当托管在 Azure Repos 中时,是否有办法在具有开放 PR 的分支上禁用 CI?

我们有一个用例,我们的代码完全托管在 Azure DevOps 中(管道、存储库等)。我们需要构建和部署“完整”构建/部署流程来部署无服务器功能。我们理想的情况是在 PR 打开和更新时有一个单一的构建/部署过程。Individual CI我们有一个构建验证策略,当 PR 接受另一个策略时,我们希望忽略该构建push,因为Build Validation策略应该取代该trigger块。

pr由于Azure Repos 无法使用触发器,有没有办法实现此目的?

存储库类型:Azure 存储库 Git

# The pipeline will fail if a branch is not either 'main' or 'something/12345-something'
trigger:
  paths:
    exclude:
      - azure-pipelines-cleanup.yaml
      - docs
      - README.md

name: $(SourceBranchName).$(Rev:r)_$(Build.RequestedFor)

resources:
  repositories:
    - repository: pipeline
      type: git
      name: <Org Obscured>/infra-pipeline
      ref: feature/212242-pipeline-housecleaning # this is pipeline branch ref, should be main unless testing pipeline changes

# This extends a template …
Run Code Online (Sandbox Code Playgroud)

git azure-devops azure-pipelines azure-repos

2
推荐指数
1
解决办法
2893
查看次数

Azure DevOps 服务挂钩和服务连接之间有什么区别

我试图了解 Azure DevOps 中服务挂钩和服务连接之间的区别。根据这些描述,服务挂钩和服务连接似乎都做同样的事情。

“服务连接使您能够连接到外部和远程服务以执行作业中的任务。” 服务连接

“当 Azure DevOps 项目中发生事件时,服务挂钩可让您在其他服务上运行任务。” 服务挂钩 这些页面都没有告诉读者服务挂钩和服务连接之间的区别。尽管我确信每个都用于不同的目的。

azure-devops azure-pipelines

2
推荐指数
1
解决办法
2906
查看次数