i have release pipelines which gets triggered on pipeline resources but would like to have release pipeline gets tagged with triggering pipeline(build) info, so we can have filter about what deployed on when.
I am trying to tag release pipeline with apiname variable using logging command, but i am unable to see them or filter with them .
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)"
echo "##vso[task.setvariable
variable=dockertag]$(resources.pipeline.pipeline1.sourceCommit)
| cut -c -7"
echo "##vso[task.setvariable variable=helmpath]P02565Mallorca/pipeline1-api"
elif [ "$(alias)" = "pipeline2" ]; then
echo "##vso[task.setvariable
variable=apiname]$(resources.pipeline.pipeline2.pipelineName)"
echo "##vso[task.setvariable
variable=dockertag]$(resources.pipeline.pipeline2.sourceCommit)
| cut -c -7"
echo "##vso[task.setvariable variable=helmpath]P02565Mallorca/pipeline2-api"
fi
- script: echo "##vso[build.addbuildtag]$(apiname)"
release pipeline runs:
[![enter image description here][1]][1]
it does not show any tags while filtering and it simply says no tags
below is the screenshot of bash script which set tag [![enter image description here][2]][2]
but unable to filter is using this tag. [1]: https://i.stack.imgur.com/BVjGS.png [2]: https://i.stack.imgur.com/YaXJJ.png