azure devops steps.script vs cmdline@2/ bash@3
步骤。目的尚不清楚。它仅允许执行内联脚本?我实际上想将文件与steps.script一起使用,而不是内联脚本。
我不能在Windows上使用cmdline@2,也不能在linux/unix上使用bash@3而不是stepsript。
speps.script的链接: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/steps-script?view = azure-pipelines
bash@bash@3: https://learn.microsoft.com/en-en-en-us/ azure/devops/pipelines/tasks/bash/bash?view = azure-devops
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
脚本步骤是YAML中的平台不可知论:
您还可以明确使用
pwsh:
或powerShell:
或bash:
明确选择某个脚本类型。这些是相应任务的便利捷径,这是来自powershell@2
文档:其他YAML便利捷径也是如此。
基本上,您可以选择哪一个以及使用快捷方式或完整步骤名称。
The Script step is a platform agnostic step in YAML:
You can also explicitly use
pwsh:
orpowershell:
orbash:
to explicitly pick a certain script type. These are convenience shortcuts for the respective tasks, this is from thePowerShell@2
docs:The same applies to the other YAML convenience shortcuts.
It's basically up to your preference which one you pick and whether you use the shortcut or the full step name.