Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
426 views
in Technique[技术] by (71.8m points)

api - What is the difference and relationship between an Azure DevOps Build Definition, and a Pipeline?

I am trying to automate a process in Azure DevOps, using the REST API. I think it should go like this (at least, this is the current manual process):

  • fork repo
  • create pipeline(s) based using YAML files in newly forked repo
  • run pipelines in particular way

I am new to the Azure DevOps REST API and I am struggling to understand what I have done and what I should be doing.

Using the REST API, I seem to be able to create what I would call a pipeline, using the pipeline endpoint; I do notice that if I want to run it, I have to interact with its build definition instead.

Also, looking at code other colleagues have written, it seems (though I may be wrong) like they are able to achieve the same by simply creating a build definition, and not explicitly creating pipeline.

This lack of understanding is driving me bonkers so I am hoping someone can enlighten me!

Question

What is the difference, and relationship, between a Build Definition and a Pipeline?


Additional info, I am not interested in working with the older Release Pipelines and I have tried to find the answer among the Azure DevOps REST API docs, but to no avail.

question from:https://stackoverflow.com/questions/65882806/what-is-the-difference-and-relationship-between-an-azure-devops-build-definition

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you want to create a pipeline you can do this using both of this. However, the difference is actually in terms of concept:

  • build definitions are part of first available flow which consist: build and release where build was responsible for building, testing and publishing artifact for later use in releases to deploy
  • pipeline are a new approach which leverage YAML designed process for building/testing/deploying code

More info you can find here - Whats the difference between a build pipeline and a release pipeline in Azure DevOps?

And for instance for this pipeline/build

https://dev.azure.com/thecodemanual/DevOps%20Manual/_build?definitionId=157

where definition id is 157

You will get reposnses in both endpoints:

https://dev.azure.com/{{organization}}/{{project}}/_apis/build/definitions/157?api-version=5.1

and

https://dev.azure.com/{{organization}}/{{project}}/_apis/pipelines/157?api-version=6.0-preview.1

and in that term pipeline id = build id


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...