[英]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.