skip to Main Content

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


  1. 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):

    I got multiple repositories and in the master branch i configure a
    verification CI. e.x I got repo x with x_CI-verify and x_CI-build
    repo y with y_CI-verify and y_CI-build and so on.

    In branch master for each repo i should configure each verify CI. To
    avoid configuring one by one for each repo the right CI i want to
    create this ‘master CI’ which is build, get the repo name(x name) and
    build the x_CI-verify.

    The best approach is to work with templates.
    These templates can then be referenced from your X, Y, etc repos.

    [template example]

    You still have create an azure-pipeline.yml in the X, Y repo and use the template:

    resources:
      repositories:
      - repository: templates
        type: git
        name: Build-Templates
    
    extends:
      template: apps.yml@templates
    

    More info about templates, for example the use with parameters, check the documentation here.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search