如何在 Azure 管道上从 repo 执行 .exe 文件
How to execute .exe file from repo on azure pipeline
我的控制台应用程序在存储库中有一个 .exe 文件,我想 运行 它在管道上。
我尝试使用 cmd 任务,但它一直失败,说它找不到我的 .exe 文件。
基本上我尝试了 here
上的步骤
当我完全按照上面 link 的步骤操作时,日志显示了这个
/home/vsts/work/_temp/7b7bec7c-25c2-4077-bdfb-052d01fcc054.sh: line 1: ConsoleApp.exe: command not found
##[error]Bash exited with code '127'.
然后我尝试更改脚本,
来自简单
ConsoleApp.exe
进入
$(Build.SourcesDirectory)/ConsoleApp.exe
然后又给我一个错误
/home/vsts/work/_temp/da794edd-60c7-43c5-bd5d-eeff7fbefa46.sh: line 1: /home/vsts/work/1/s/ConsoleApp.exe: Permission denied
##[error]Bash exited with code '126'.
现在我开始 运行 不知道为什么会这样,所以如果有人能帮助我,那就太好了。
如果您想重现 article 中的步骤,您必须使用:
- Command Line Script
- Windows-2019 vmImage
Finally, I setup a pipeline with a “Command Line Script” task to run
the executable. Since it’s a Windows executable file, I set the Agent
specification to “Windows-2019”.
在你的例子中,你使用了 Linux vmImage。
根据我的测试,我可以在 Linux Agent 中重现这个问题。
要解决此问题,您需要检查以下两个字段才能使用Windows-2019 Agent.
- 管道 -> 代理规范
- 代理作业 -> 代理规范
默认情况下,它将遵循代理作业范围中的设置。
结果:
我的控制台应用程序在存储库中有一个 .exe 文件,我想 运行 它在管道上。 我尝试使用 cmd 任务,但它一直失败,说它找不到我的 .exe 文件。
基本上我尝试了 here
上的步骤当我完全按照上面 link 的步骤操作时,日志显示了这个
/home/vsts/work/_temp/7b7bec7c-25c2-4077-bdfb-052d01fcc054.sh: line 1: ConsoleApp.exe: command not found
##[error]Bash exited with code '127'.
然后我尝试更改脚本, 来自简单
ConsoleApp.exe
进入
$(Build.SourcesDirectory)/ConsoleApp.exe
然后又给我一个错误
/home/vsts/work/_temp/da794edd-60c7-43c5-bd5d-eeff7fbefa46.sh: line 1: /home/vsts/work/1/s/ConsoleApp.exe: Permission denied
##[error]Bash exited with code '126'.
现在我开始 运行 不知道为什么会这样,所以如果有人能帮助我,那就太好了。
如果您想重现 article 中的步骤,您必须使用:
- Command Line Script
- Windows-2019 vmImage
Finally, I setup a pipeline with a “Command Line Script” task to run the executable. Since it’s a Windows executable file, I set the Agent specification to “Windows-2019”.
在你的例子中,你使用了 Linux vmImage。
根据我的测试,我可以在 Linux Agent 中重现这个问题。
要解决此问题,您需要检查以下两个字段才能使用Windows-2019 Agent.
- 管道 -> 代理规范
- 代理作业 -> 代理规范
默认情况下,它将遵循代理作业范围中的设置。
结果: