英文:
Is there a way to automatically setup the azure devops pipeline from existing YAML?
问题
I have a few YAML files already hosted on a devops repo. Is there any way to automatically create a devops pipeline from these YAML files and not go through the wizard of setting up the pipeline.
This situation will also arise while setting up a new repo. I'm setting up tenancy for my platform and need to automatically set up a few pipelines when I bootstrap the repo.
Don't want to go through the below wizard to set up the pipeline.
英文:
I have a few YAML file already hosted on devops repo. Is there any way to automatically create devops pipeline from these YAML file and not go through the wizard of setting up the pipeline.
This situation will also arise while setting up a new repo. I'm setting up tenancy for my platform and need to automatically setup a few pipelines when i bootstrap the repo.
Don't want to go through the below wizard to setup the pipeline:
答案1
得分: 1
You can automate it with Rest API.
使用 Pipelines - Create:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1-preview.1
一个示例请求体:
$body = @{
configuration=@{
variables=@{
customVariable=@{
value="value"
}
};
path="azure-pipelines.yml";
repository=@{
id= "repository-id";
name="repository-name";
type= "azureReposGit";
};
type= "yaml"
};
name= "pipeline-name";
folder= "\\"
}
英文:
You can automate it with Rest API.
Use the Pipelines - Create:
POST https://dev.azure.com/{organization}/{project}/_apis/pipelines?api-version=7.1-preview.1
An example to body:
$body = @{
configuration=@{
variables=@{
customVariable=@{
value="value"
}
};
path="azure-pipelines.yml";
repository=@{
id= "repository-id";
name="repository-name"
type= "azureReposGit"
};
type= "yaml"
};
name= "pipeline-name";
folder= "\\"
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论