azure devops shows 'set up build' button - azure

I am using git service of azure devops.
I have my build pipeline setup with master branch using yml file.
And it runs & perform well.
Question is on Azure UI: Why does it show me the button 'Set up build' i already have my pipeline setup.
The reason is that the latest commit did not trigger my pipeline as we are excluding build trigger for README file changes.
(Build status links with commit id)
is there anyway to show the latest build status instead of this button.

Azure DevOps provides this quick way to set up yaml pipeline using this “Set up build” button when new repository is created. When you click this button to set up yaml pipeline and queue a new build, this button will show you the latest build's state( the build status is linked with commit-id), as below.
To your situation, as this ticket suggested, you could see the build status in the other place, such as Commits hub, Dashboad, build status badges and so on.

This happens if we commit some files which is part of exclusion in pipeline trigger, as in this particular commit there is no pipeline status is linked.

Related

How to send work items through release pipeline after deployment azure devops

How to send work items through release pipeline after deployment completed in azure devops
I try to use send email task but there is no option
You can link Work Items to your pipeline like below:-
I went to my Release pipeline and Options > Integrations> Report Deployment Status to work and Report Deployment Status to Boards refer below:-
I did one commit in my existing pipeline repo and linked a Work Item to it like below:-
The Pipeline started running after the commit and the task was added to the work item like below:-
Work Item:-
Now, I triggered a release pipeline for the same and checked if the work items are included like below:-
After the release is complete click on 3 dots like below and select Send Email
Now, As this Work item is included in the build, I send it via Email, You can enable Email notifications at the Organizational level and Project Level both.
Project Level > Project > Project settings > Notifications > New subscriptions > Build > A Build completes >
You can also create a notification for Release refer to below:-
I received an Email after the successful build and release with the associate artifact like the one below:-
You can enable this Email Notification at the Organizational level too.
Additionally while running pipelines, You can follow the steps below:-
Reference:-
Configure pipelines to support integration - Azure DevOps | Microsoft Learn

Azure Devops pipeline trigger when a new version of helm chart is published in ACR

Current my CI pipeline is building, packaging and publishing the artifacts(docker image/helm chart) to ACR.
I want to trigger my CD(continuous delivery) pipeline when either a new helm chart version/ docker image tag is published in the ACR. There are ways to do this for docker image using resources.containers.container[]. How can I put another trigger in ADO pipeline to run it when new helm chart version is published?
Here is a workaround:
Step 1. In your build pipeline, you can set a variable as a flag to show whether you have a new helm chart version published. And use it as a condition to set build tag. Here is an example:
- script: echo "##vso[build.addbuildtag]HelmChart"
condition: eq(variables.varName, 'true')
Step 2. In your release pipeline, select your build as an artifact. Click on the lightening icon in your stage to set triggers:
Enable the "Artifact filters". Add your build. Fill in "build tags" with the value you set earlier in the build pipeline.
Then the pipeline will be triggered if a new helm chart version is published.

Tag version check between two pipelines azure devops

I have two CI pipelines in azure devops:
CI pipeline to train models
CI pipeline to score/predict/inference new data
Both of these pipelines are triggered when a PR is created on a specific branch. I have enabled "Tag Builds" on succeed with $build.BuildNumber format. I beleive if the builds are successful, they are given some tags.
I have a release pipeline, what I want to do is to check if the tag/buildNumber for 1st and 2nd CI pipelines are same or not. If not, the release pipeline should fail.
The problem is I cant find any tag information of the CI pipelines here is what I see after a build is succeeded.
I found out that. It is not possible to check if two or more tags are valid based on some logic in devops. So, we ended up using bash task and git commands to check if tags are valid (using regex).

Restrict Pull Requests Between specific Branches

We have a pre-deployment branch and a production branch, and would like to set security such that you can only create pull requests to the production from pre deployment and not from other branches.
How can i do this ?
Thanks
There are workaround to achieve this.
You should first create a build pipeline with a powershell task executing below script to check if the pull request source branch is the restricted branch.
$sourceBranch = "$(System.PullRequest.SourceBranch)"
if($sourceBranch -ne "refs/heads/pre-deployment")
{
exit 1
}
And then add this build pipeline to the build policy under Build validation in branch policies of your production branch. After setting above build policy, the new pull request will trigger the build pipeline and fail if the source branch is not pre-deployment
Another way to do this is creating a pull request status server. please refer to the example here for more information

Azure devops cicd gitlab integration

I am using an external private gitlab repository for code and using azure-devops for cicd pipeline. When the user checks in code to the gitlab project repository azure-devops builds and releases. It names the build as CI BUILD. How can I get username and current changeset (name of the user who just checked in his code and his changeset files name) to show with build in azure-devops?
You can click on the build record of the CI trigger in the build pipeline.
The username of the changer and commit will be displayed at the top of the record. Click commit and you will be taken to the changed file.
In the sample ,I use the github repository for code ,I think the same is true with gitlab.

Resources