标签: azure-pipelines

用于多级管道的 azure devops 仪表板

我在 YML 文件中创建了一个多阶段管道,包括构建阶段以及部署到开发、测试和生产。我希望有一个仪表板来显示部署状态以及部署到每个阶段的发布版本?我检查“部署状态”小部件,但它仅适用于发布选项。那么有人有经验支持我吗?

azure-devops azure-pipelines azure-pipelines-release-pipeline azure-pipelines-yaml azure-dashboard

3
推荐指数
1
解决办法
3569
查看次数

Azure DevOps - 如何更新管道存储库源而不重新创建新的存储库源?

我计划将我的 Azure 管道源文件移动到新的 Azure 存储库。如何更新现有管道设置以指向新的 Azure 私有存储库位置?我不想重新创建存储库和变量。现在,如果我编辑当前管道设置,它只允许我从当前存储库中选择 .yml 文件。没有更改回购的选项。

谢谢

azure-devops azure-pipelines

3
推荐指数
1
解决办法
2414
查看次数

从 azure Devops 管道运行网页中删除提交消息?

我知道如何更改 runName(也称为 Build.BuildNumber),但如下所示图片提交消息也会显示(这是 devops 中的管道页面),即使它不是我设置的名称的一部分。当我不更改名称时,也会出现这种行为,它看起来就像yyyyMMdd.rev <commit message>.

我不希望出现该消息,因为我设置的 BuildNumber 更好地描述了管道的运行情况,并且提交消息可能会令人困惑。是否可以从该列表中删除提交消息?请注意,这是由新的 yml 管道定义的。

git azure-devops azure-pipelines azure-pipelines-yaml

3
推荐指数
1
解决办法
2528
查看次数

在 Azure DevOps Pipeline 中找不到 Pytest

在我的 Azure DevOps 管道中

https://dev.azure.com/TheNewThinkTank/dark-matter-attractor/_build?definitionId=2&_a=summary

我有一个测试阶段,我希望在相应的 Azure DevOps 存储库中的所有 Python 文件上安装并运行 pytest

https://dev.azure.com/TheNewThinkTank/_git/dark-matter-attractor)。

Pytest的安装和运行方式遵循微软官方文档:

- script: |
    pip install pytest
    pip install pytest-cov
    pytest tests --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
  displayName: 'Test with pytest'
Run Code Online (Sandbox Code Playgroud)

可以在以下位置找到:https://learn.microsoft.com/en-us/azure/devops/pipelines/ecosystems/python ?view=azure-devops

运行 Pipeline 会导致上述步骤出错: pytest: command not found

如果您想查看完整的回溯:

https://dev.azure.com/TheNewThinkTank/dark-matter-attractor/_build/results?buildId=62&view=logs&j=792982d5-3bb1-5d82-222e-228148b73448&t=1f7e9bd0-3cdf-5b91-30b0-87c9b2af71b7

我尝试过的其他事情:

在官方 pytest 网站(https://docs.pytest.org/en/stable/getting-started.html)之后,我尝试向安装命令添加一个标志: pip install -U pytest,但结果相同。

是什么阻止管道发现已安装的 pytest 模块?

python bash pytest azure-devops azure-pipelines

3
推荐指数
1
解决办法
3671
查看次数

在 Azure Pipeline 任务中运行 CURL GET 命令

我希望在 Azure Pipeline 任务中运行一些 CURL 命令(主要是 GET),以从几个来源列出/下载一些工件。如果有任何关于如何使用 CURL、Powershell、Windows 命令或任何其他适当方法通过管道任务实现此目的的示例,我将不胜感激。

谢谢

rest curl azure-pipelines azure-artifacts azure-pipelines-tasks

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

Azure DevOps:仅当上一个任务运行时才运行任务

我希望该PublishTestResults@2任务仅在前一个任务script(运行单元测试)实际运行时才运行。

  • 如果我使用condition: succeededOrFailed()thenPublishTestResults@2运行,即使上一步没有运行 - 我认为这就是目的condition: always()
  1. 即使前一个任务失败了,如何使任务取决于前一个任务?
  2. always()和 和有什么区别succeededOrFailed()

参考

    # This step only runs if the previous step was successful - OK
    - script: |
        cd $(System.DefaultWorkingDirectory)/application/src
        yarn test:unit --silent --ci --reporters=jest-junit
      displayName: 'Jest Unit Tests'
      env:
        JEST_JUNIT_OUTPUT_DIR: $(System.DefaultWorkingDirectory)/testresults
        JEST_JUNIT_OUTPUT_NAME: 'jest-junit.xml'

    # This step ALWAYS runs - NO
    #  This step should ONLY run if the previous step RAN (success OR fail)
    - task: PublishTestResults@2
      displayName: …
Run Code Online (Sandbox Code Playgroud)

azure-devops azure-pipelines azure-pipelines-yaml

3
推荐指数
1
解决办法
5815
查看次数

如何使用 Azure DevOps Services 管道 yaml 中的变量指定触发器

以下天蓝色管道代码给出错误

“在此上下文中不允许使用模板表达式”

variables:
  major: 2020
  minor: 3
  patch: 1
  major_minor_patch: $(major).$(minor).$(patch)

trigger:
- master
- Dev
- release/R${{variables.major_minor_patch}}
- release/${{variables.major_minor_patch}}/*
Run Code Online (Sandbox Code Playgroud)

我的目的是使用主要、次要和补丁变量来指定形成 CI 触发器的分支,而不是在管道 YAML 中对其进行硬编码。

  1. 由于找不到解决我的场景的文档,我错过了什么?
  2. 如果我想做的事情不受支持,是否有建议的方法可以实现相同的目标?

谢谢

azure-pipelines azure-pipelines-tasks

3
推荐指数
1
解决办法
7881
查看次数

在 Azure 管道中使用 Docker 映像作为构建代理时出现错误

我正在尝试使用 Docker 映像作为 Azure 管道中的构建代理。我正在使用 Azure DevOps Server 2019 和 Docker 企业版。

管道运行时出现此错误:

##[section]Starting: Initialize containers
##[command]C:\Program Files\Docker\docker.EXE version --format '{{.Server.APIVersion}}'
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/version: open //./pipe/docker_engine: Access is denied. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
'
##[error]Exit code 1 returned from process: file name 'C:\Program Files\Docker\docker.EXE', arguments 'version --format '{{.Server.APIVersion}}''.
##[section]Finishing: Initialize containers
Run Code Online (Sandbox Code Playgroud)

我已经验证服务器上安装了 Docker。我运行了以下命令来确保 Docker …

docker azure-devops azure-pipelines

3
推荐指数
1
解决办法
2459
查看次数

在 Azure Devops 管道上运行 Flutter 集成测试以进行 UI 自动化测试

我想在 Azure Devops Pipelines 上使用 flutter 驱动程序运行自动化 UI 测试,并且我正在使用Alois Daniel 的 Flutter Tasks。azure flutter 任务插件目前不支持 flutter 驱动程序。我们正在寻找在运行 flutter 驱动程序测试时启动 Android 和 iOS 模拟器的任务。我们正在 azure devops pipeline yml 文件中运行 macos-latest 的 vm-image。

azure-devops azure-pipelines flutter-test

3
推荐指数
1
解决办法
1776
查看次数

Excluding Certain Files in Azure CI Pipeline (YAML)

I have a CI pipeline (YAML) that builds a repo that will deploy into an existing Azure Function. The CI pipeline is doing it is job. However, after it is done, and I go to Function App -> App files -> I can see the azure-pipeline.yml is included in there (or i think it was included in the build process). I have tried using paths and exclude but they dont work. My question is, how do I exclude only that …

yaml azure azure-devops azure-pipelines

3
推荐指数
1
解决办法
1万
查看次数