简体   繁体   English

如何在 py 脚本的 azure devops pipline 中调用 repo 路径

[英]How to call repo path in azure devops pipline for py script

I have python script stored on my repo and i'm trying to create pipeline to run it.我的存储库中存储了 python 脚本,我正在尝试创建管道来运行它。 I have no idea how to ptovide correct path to the repo where it is stored.我不知道如何提供存储它的 repo 的正确路径。 I receive no such file or directory, stat '/home/vsts/work/1/s/vg/main.py'no such file or directory, stat '/home/vsts/work/1/s/vg/main.py'收到no such file or directory, stat '/home/vsts/work/1/s/vg/main.py'

repo: vg回购: vg

yaml: yaml:

steps:
- task: PythonScript@0
  inputs:
    scriptSource: 'filePath' # Options: filePath, inline
    scriptPath: $(Build.SourcesDirectory)/vg/main.py # Required when scriptSource == filePath
    #script: # Required when scriptSource == inline
    arguments: $(file_path) $(pat) $(organization) $(project) $(vg_name)
    #pythonInterpreter: # Optional
    #workingDirectory: # Optional
    #failOnStderr: false # Optional
- bash: python $(Build.SourcesDirectory)/vg/main.py
- script: python $(Build.SourcesDirectory)/poc/main.py

If this is your only repo it is downloaded directly to source folder so your script should be here $(Build.SourcesDirectory)/main.py如果这是你唯一的仓库,它会直接下载到源文件夹,所以你的脚本应该在这里$(Build.SourcesDirectory)/main.py

Please check this checkout path section to understand how and where source code is downloaded.请检查此结帐路径部分以了解下载源代码的方式和位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 azure devops 管道编辑 azure repo 中的 py 文件? - how to edit py file in azure repo using azure devops pipline? Azure devops 跳过构建管道 - Azure devops skip build pipline 如何将 Powershell 脚本文件路径从 azure devops repo 传递到 Azure devops 构建管道 - how to pass Powershell script filepath from azure devops repo into Azure devops build pipeline 如何将 Azure DevOps 存储库与 GitHub 存储库同步 - How to synchronize Azure DevOps repo with GitHub repo Azure 数据工厂访问策略分配使用 azure powershell devops 管道中的内联脚本 - Azure data factory access policies assigment using azure powershell inline script in devops pipline 如何在 Azure 上创建新的构建代理以与我的私有 DNS 和 Azure DevOps 上的发布管道进行通信? - How can I create a new build agent on Azure to communicate with my private DNS and the release pipline on Azure DevOps? 如何将Azure Devops Repo与Gitlab同步 - How to sync Azure Devops Repo with Gitlab Azure Devops:如何配置我的管道脚本以触发具有不同 repo 的另一个管道? - Azure Devops: how configure my pipeline script to trigger another pipeline with different repo? PowerShell任务脚本路径Azure DevOps发布 - Script path of PowerShell task Azure DevOps release Azure Devops Piepeline - Yaml Powershell 脚本路径 - Azure Devops Piepeline - Yaml Powershell Script Path
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM