Score:2

How to keep pipeline files in a separate repository for azure devops pipeline?

cn flag

Is there any way to keep the pipeline file separately in a different repo than the one in source code?

So that, we can maintain all the pipelines related data in a separate repository but the pipeline should detect changes from the main repo.

Example:

I have a repo my-code-base and instead of creating pipeline in my-code-base, I will create a separate repo my-infra and save the pipeline files there.

But in the pipeline I should set the code should be picked from my-code-base.

Please suggest.

If it works, we can save all the azure devops CI/CD pipelines in my organization to be maintained separately.

Score:3
cn flag

I am definitely no ADO expert but isn't the point of Pipelines that they go "hand-in-hand" with the codebase that they deploy, which is why they go into the same Repo?
Basically, Our Friends in Redmond have assumed that every Application will need to be deployed subtly differently from every other Application so, by default, the [unique] deployment pipeline for every Application "lives" with that Application.

Nothing like "Standardisation".

Score:0
cn flag

I'm not an Azure expert, but it looks like it's possible:

The following combinations of checkout steps are supported.

No checkout steps: The default behavior is as if checkout: self were the first step, and the current repository is checked out.

A single checkout: none step - No repositories are synced or checked out.

A single checkout: self step - The current repository is checked out.

A single checkout step that isn't self or none - The designated repository is checked out instead of self.

Multiple checkout steps - Each designated repository is checked out to a folder named after the repository, unless a different path is specified in the checkout step. To check out self as one of the repositories, use checkout: self as one of the checkout steps.

So I'd guess you can track your pipelines repo to ensure that it gets monitored, and alter the checkout targets in the file to pull the target repository?

Sara June avatar
cn flag
But it seems, it won't detect the changes from the source code repository, it is only detecting changes in the repository where the pipeline file is saved.
cn flag
Looks like it does: `You can trigger a pipeline when an update is pushed to the self repository or to any of the repositories declared as resources. This is useful, for instance, in the following scenarios:` from the same page
Sara June avatar
cn flag
It is not able to access any repositories or clone it. Can you give a sample pipeline you tried.
cn flag
I've not tried it myself, but the documentation certainly makes it sound like you can configure a Trigger to monitor both repositories that you are interested in. I'll see if can do some testing after work and paste in an example pipeline.
Tim van Oostrom avatar
tk flag
The same page as mentioned in the answer also notes: `Repository resource triggers only work for Azure Repos Git repositories in the same organization at present. They do not work for GitHub or Bitbucket repository resources. batch is not supported in repository resource triggers.`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.