azure - 更改 Azure Pipelines 中的当前工作目录

标签 azure azure-devops azure-pipelines

我正在 Azure Pipelines 中开发 Python 包的 CI ( https://github.com/scikit-image/scikit-image/blob/azure-pipelines/azure-pipelines.yml )。在某些时候,我需要退出源代码目录,以允许 pytest 发现此包的安装,并运行相应的测试。

我面临的问题与 cdcd C: 等命令似乎没有产生任何效果有关,因此当前的工作目录保持不变(在本例中为 D:\a\1\s)。

有没有办法克服所描述的限制?

最佳答案

花了很多时间才找到解决方案,但是,显然,有一种方法来指定特定脚本的工作目录 - https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/command-line?view=vsts&tabs=yaml :

- script: # script path or inline
  workingDirectory: #
  displayName: #
  failOnStderr: #
  env:  # mapping of environment variables to add

关于azure - 更改 Azure Pipelines 中的当前工作目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53857085/

相关文章:

.net-core - 在 Azure Pipelines 构建中命名生成的 ZIP 存档?

azure - 如何测试 Azure 市场报价?

azure-devops - 通过REST API获取工作项的父项

Azure Pipelines : Variable not taking assigned value, 相反解析为 $(variableName)

Powershell 构建步骤,一劳永逸?

git - VSTS : Different merge commit message

azure - 无法更新 Azure devops 中 Azsk 任务中的策略设置

azure - 在 azure pipeline 中运行 terraform 以部署到另一个租户

asp.net-mvc - WebAPI + Azure 网站 + 客户端网站 + SSL - 我需要多少个证书?

azure - 是否可以在 ubuntu arm64 中安装最新的 azure-cli