无法通过管道触发来自Azure Repo的Shell脚本
我在Azure存储库中已exploy.sh文件,需要从Azure Pipeline执行此Deploy.sh文件。
这是我在管道中定义的步骤。我尝试通过CMD和Bash进行两种方法,两者都没有选择Deploy.sh文件的正确位置
。
这是我遇到的错误:
这是CMD的错误,但是CMD即使路径不正确
这是bash
问题
如何更正路径并成功执行Deploy.sh?
I have deploy.sh file in my azure repository and i need to execute this deploy.sh file from azure pipeline.
Here is the steps that i defined in pipeline. I tried two ways to do it through cmd and bash, both are not picking the right location of deploy.sh file
Here is the error i am getting:
This is the error from CMD, but CMD shows green even though path is not correct
This is the error for bash
Question
How to correct the path and do successful execution of deploy.sh?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您绝对不应硬编码管道运行的路径。相反,您应该使用预定义的变量,该变量将自动选择构建ID以及路径。对于您的情况,
如果您有多个存储库结帐,则需要使用存储库的名称,例如
$(pipeline.workspace)/s
也应由$(构建。 sourcesDirectory)
预定义的变量应遵循.yml文件上的
$(var)
符号You should never hard code the path of the pipeline run. Instead you should use the predefined variables that will automatically pick the build ID and also path. For your case you will need the
If you have multiple repositories checkout you should also use the name of the repository like
$(Pipeline.Workspace)/s
should be also replaced by$(Build.SourcesDirectory)
The predefined variables should follow the
$(var)
notation on the .YML file这解决了我的问题
This solved my issue