选择槽代理的Azure管道条件

发布于 2025-01-24 12:27:13 字数 423 浏览 4 评论 0原文

我想在管道中插入条件, 具体来说,我希望从默认代理到自定义一个的Swich Pipeline ,ho将此条件插入管道中时? NB:我刚刚在azure中创建并安装了我的自定义代理,

例如我的azure pipelines.yml文件:

trigger:
- feature/test_pipeline


**how to insert an 'if condition' to choose different agent
if default is not available or get error** 

pool:
  vmImage: ubuntu-latest

steps:

- script: |
    echo "my power script"
  displayName: 'Run script' ```

I would like to insert a condition in my pipeline,
specifically I would like the swich pipeline from the default agent to the custom one when I get an error, ho to insert this condition in pipeline?
NB: I have just created and installed my custom agent on private VM in azure

eg this is my azure-pipelines.yml file:

trigger:
- feature/test_pipeline


**how to insert an 'if condition' to choose different agent
if default is not available or get error** 

pool:
  vmImage: ubuntu-latest

steps:

- script: |
    echo "my power script"
  displayName: 'Run script' ```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸵鸟症 2025-01-31 12:27:13

选择槽代理的Azure管道条件

恐怕目前没有这样的方法可以做到这一点。

众所周知,当我们执行管道时,将预先编译YAML文件。在兼容阶段,将解析YAML以确定是否存在语法或逻辑错误。

但是,如果您不输入汇编和执行阶段,则无法知道代理的状态。

因此,不可能在兼容阶段判断代理商的状态。

Azure pipeline condition to choose trough agent

I am afraid there is no such way to do this at this moment.

As we know, the YAML files are precompiled when we execute our pipeline. During the pre-compilation phase, the YAML will be parsed to determine whether there are syntax or logical errors.

However, if you do not enter the compilation and execution stage, you cannot know the state of the agent.

Therefore, it is impossible to judge the state of the agent in the pre-compilation stage.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文