When you create new CI pipeline you can add agent job and agentless one.
My first question is: why is necessary to select a repository while you create an agentless job? Why is so repository dependent?
Is it possible to create a CI pipeline without selecting a repository?
Thank you in advance
Expecting to create an agentless CI without selecting a git repository in Azure Devops
2
Answers
No, it is not possible to create a (YAML) CI pipeline without a repository. In the YAML case it has to store the YAML file somewhere (right: in the repo).
In your case, for an agentless job, just use an "empty" repo with only the YAML, which is then perfectly versioned through git 😉
Edit
Based on you recent comments (below):
The best approach is to work with templates.
These templates can then be referenced from your X, Y, etc repos.
[]
You still have create an
azure-pipeline.yml
in the X, Y repo and use the template:More info about templates, for example the use with parameters, check the documentation here.
No, it is not possible to create a Pipeline without selecting a repository. The reason is that the repository needs to be selected on the Pipeline level, not on job level. This means that when we create a new Pipeline, it is configured to have multiple stage(s) and those stage(s) can have multiple jobs (agent/agentless). The repository needs to be added to add flexibility to the pipeline which should be able to refer an existing script or a YAML file in the source control that was configured earlier.
If in the future Azure DevOps looks to add feature to create standalone agentless jobs, then it would make sense not to have an option for repositories.