Azure DevOps Keeps Creating Default Build Pipeline - azure-devops

I have a YML file that is a standard template that is called by all my build definitions.
Each of the builds passes parameters into the YML file.
Unfortunately, every now and then, Azure DevOps tries to automatically create a build definition called "--REPO NAME-- CI". I know it's due to the YML template file, but I don't want it to generate that. How do I prevent this Build definition from getting automatically created.

Related

Azure DevOps single pipeline for multiple projects without multiple azure-pipelines.yml files

We have an Azure DevOps Pipeline defined as a template in a .yml file, and would like to use this to build 100+ projects.
There is zero parameterization to do, and the template essentially just runs against the project repo as-is.
Normally, we would just go into each of those project repos and create an azure-pipelines.yml file and reference the template pipeline, easy.
However, I would like to know if we can avoid creating these azure-pipelines.yml in each of the 100+ project repos. Is there some way to just run the template against 100+ repos, but as separate pipelines?
No.
YAML pipelines are based upon the YAML being stored in the application's repo, as code, alongside the application code. You can pull in templates from other repos, but you can't have one pipeline that is automatically valid for any repo.
Trying to use one template to build 100+ applications without the possibility of pinning the template to a specific version on an application by application basis is setting yourself up for a nightmare at some point in the future, when the template changes in such a way that it's no longer valid for a subset of your 100 applications.

Is there a way we can deploy all the cloudformation templates from a gitlab repository using gitlab pipeline in aws in a single stack?

I'm looking for an option to pick all the templates from the repository without hardcode the yml template files and in future if new templates are added, the pipeline should automatically pick all of them and do the deploy and create a single stack in aws environment, without making any modification to gitlab-ci.yml/pipeline file.
I tried using deploy CLI command, it deploy all the templates but then it goes for update and start deleting one by one and only the last template resource will be available after the pipeline execution is complete.
Let me know if there is an option to do this?

Is is possible to inherit a definition of Azure DevOps Pipeline?

I would like to know if there is a mechanisim in Azure DevOps to reuse a definition for Azure DevOps Pipelines.
In my scenario I defined two Azure DevOps (Build) Pipelines to generate the artifacts of my web app; one for staging the other for production. The build definiton is the same in both cases except for two things:
a variable that set the build configuration for the ASP .NET Core (Staging or Release)
the branch that triggers the build (staging or master)
My goal is to avoid duplicated build definition that should be updated in both whenever somehting is updated in the project.
The build definition are in classic mode (no YAML files).
With classic you can create task groups and reuse those. You can select existing build steps and convert them to a task group and then reuse the task group across builds.
This is covered in the following document.
With yaml files you can use templates.

All Build and Release Definition Export At Once?

Is there a way to export all Build and/or Release Definitions at once in Azure DevOps, instead of doing it one by one ?
Thank you.
You can do that by calling Azure DevOps Pipelines REST API. Start by query all build and release definitions, and iterate on each of the definitions to get the JSON detail of the definition.
But if your build is using YAML file, then the build definition will only container definition of where to search the YAML file and also the variable and trigger settings.

Create Azure pipelines from scripts

I was playing with Azure Build pipelines. My Goal was that Developer should be able to create a Build Pipeline for their project. But he/she will not be creating it via Azure DevOps console, instead, they would Trigger a build job which would create Build pipelines for them. I was able to achieve it by having a common Template.json and invoking it using PowerShell scripts.
But I see that we can create a build pipeline by having an azure-pipelines.yaml in our repo. So I have two issues which I am struggling to face.
An Azure pipeline job that will read the azure-pipelines.yaml and create a build pipeline for the user.
Read the Azure-pipelines.yaml file which is kept inside the sub directories in the repo.
Appreciate your help.
Thanks.
Resolved :)
Created a powershell script which uses the json file which was exported from a existing pipeline job.
The JSON file will be using the azure-pipelines.yml file to create the tasks.
The Powershell script updates the json file and makes a rest call to create a pipeline.
The documentation is very poor . I was unable to find documentation on creation of pipeline through code . I Checked the Request body while saving the pipeline from which I was able to get the details to refer the yml file .
You can use AzurePipelinesPS to Get-APBuildDefinition and Publish-APBuildDefinition.
The functions use return and post json objects. I modify the json templates with tokens and update them are needed. Format-APTemplate will replace the tokens in the json template.
There are functions for release pipelines as well; Get-APReleaseDefinition and Publish-APReleaseDefinition.