【问题标题】:How to run a Python script on Azure Release?如何在 Azure Release 上运行 Python 脚本?
【发布时间】:2022-11-28 10:08:10
【问题描述】:

我的 Azure 存储库上有一个 python 脚本。 它称为 build.py,位于文件夹 swagger_updater 中。 我可以使用以下脚本轻松地在构建管道中使用它:

steps:
  - task: PythonScript@0
    inputs:
      scriptSource: filePath
      scriptPath: swagger_updater/build.py
      pythonInterpreter: /usr/bin/python3

现在,我想在发布管道中运行,我的 release.py 脚本位于同一个 swagger_updater 文件夹中。 我应该在脚本路径中写什么?如果我写 swagger_updater/release.py 它不起作用。 请看这个image

【问题讨论】:

    标签: python azure-devops azure-pipelines azure-releases


    【解决方案1】:

    由于发布管道将从构建管道下载工件。您可以在构建管道中使用“发布管道工件”。然后在您的发布管道中使用工件。

    在构建管道中:

    在发布管道中:

    更新: 如果您直接使用 Azure Repo,请检查以下步骤:

    【讨论】:

    • 谢谢你。那么 Release 使用脚本的唯一方法是将其作为 Build 的工件获取? Release 不能直接访问 Repository(就像 Build 那样)吗?
    • @Edoardo 我已经更新了步骤,请看一下。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-13
    • 2020-01-10
    • 1970-01-01
    • 2022-08-06
    • 2020-01-01
    • 2021-11-30
    • 2020-01-09
    相关资源
    最近更新 更多