microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 926 forks source link

Are pipeline triggers for the same pipeline supported? #546

Closed 50Wliu closed 2 years ago

50Wliu commented 2 years ago

My intention of creating an issue here is to understand if my scenario is supported; if it is, I'll follow up with DevOps support; if not, I'll open a feature request on Developer Community.

My question is: Can I create a pipeline resource that triggers on itself?

For example, let's say my multi-stage pipeline is called "ci-test" with stages "build" and "deployPPE", plus an additional "deployProd" stage that only triggers if Build.Reason == "ResourceTrigger", and has a pipeline resource as follows:

resources:
  pipelines:
  - pipeline: self
    source: ci-test
    trigger:
      stages:
      - deployPPE
      branches:
        include:
        - main

Is this scenario supported?

It was working when I was testing it out in a branch, but after adding the "branches: [ main ]" constraint and merging to main, the trigger is no longer...triggering. Hence my question.

(For context, we are trying to do this because we have a scheduled pipeline that picks up artifacts that this pipeline produces, and it is non-trivial for us to use the DownloadPipelineArtifact task because of https://github.com/microsoft/azure-pipelines-agent/issues/3511.)

KonstantinTyukalov commented 2 years ago

Hi @50Wliu, this repo is mostly for YAML templates presented in the repo. Could you please open a ticket on the developer community regarding this question?

KonstantinTyukalov commented 2 years ago

Let me close this at the moment since it's not related to the templates which repository contains. Please feel free to open a ticket on the developer community for further questions.

50Wliu commented 2 years ago

Yes that makes sense, I'll open a ticket on Developer Community when I get the chance. Thanks :)