0
votes

I have release pipeline configured which gets triggered by pipeline resources(build). i set some custom variables based on build pipelines, trying to update with release pipeline with build pipeline infos.

below is the my release pipeline code:

            resources:
            pipelines:
            - pipeline: pipeline1
              project: appcom
              source: pipeline-api
              trigger:
                branches:
                - develop
                - feat/*
            -  pipeline: pipeline2
               project: appcom
               source: pipeline2-api
               trigger:
               branches:
               - develop
               - feat/*

          variables:
          - name: alias
            value: $(resources.triggeringAlias)
          stages:
          - stage: ScanImage
            jobs:
            - job: ScanImage
               pool:
                 vmImage: 'ubuntu-16.04'
               steps:
               - script: echo $(alias)

               - task: Bash@3
                 inputs:
                 targetType: 'inline'
                   script: |
                    if [ "$(alias)" == "pipeline1" ]; then
                    echo "##vso[task.setvariable 
                    variable=apiname]$(resources.pipeline.pipeline1.pipelineName)"
                    fi
                - script: echo "##vso[build.addbuildtag]$(apiname)"

when pipeline get executed it says tag is created as shown in below picture enter image description here when i go and try to filter with tag, it says no tags as below image enter image description here

any idea on this ?a

1
If you select the first run that you think should have the tag, does it appear within the job details?WaitingForGuacamole

1 Answers

0
votes

Unable to name release(yaml) pipeline with custom variables

The tag is not displayed on the summary of the build definition directly, but we could use the filter with tag to list which pipelines contain the specified tags:

enter image description here

If you want check the tag directly, you need open one build pipeline:

enter image description here

Or you could use the REST API Builds - Get to check the tag info:

GET https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}?api-version=6.0

enter image description here

Note: The tag was added to the build Id 614011, you should make sure you check the correct pipeline.