Azure-devops-docs: Pipeline resource predefined "meta-data" variables

Created on 13 Nov 2019  ·  3Comments  ·  Source: MicrosoftDocs/azure-devops-docs

I'm trying to use the new pipeline resource to have my build pipeline trigger a CD/release pipeline.
I need to pass the Build.BuildId from my build to the release, which is a very common scenario

The docs mention pre-defined "pipeline-resource-meta-data" variables I can use. However none of these seem to be populated. These variables mention an <Alias> but it's never explained what Alias refers to? I tried the pipeline resource reference I used, but it didn't work

image

Basically the docs seem incomplete.

https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#pipeline-resource-meta-data-as-pre-defined-variables


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 devops-cictech devopprod

Most helpful comment

I have got this working now, e.g.

# Example CD release pipeline
trigger: none

resources: 
  pipelines:
  - pipeline: buildpipeline
    source: My Build Pipeline
    trigger: true

jobs:
- deployment: deployMyApp

  pool:
    vmImage: ubuntu-latest

  strategy:
    runOnce:
      deploy:
        steps:
        - download: buildpipeline
          artifact: helm-charts
        - bash: echo "Build run name was: $(resources.pipeline.buildpipeline.runName)"

I still think a worked example of CI & CD separated across two pipelines is badly needed in the docs

All 3 comments

Any response?
Linking pipelines together is practically pointless if you can not pass information like build-id between them

I have got this working now, e.g.

# Example CD release pipeline
trigger: none

resources: 
  pipelines:
  - pipeline: buildpipeline
    source: My Build Pipeline
    trigger: true

jobs:
- deployment: deployMyApp

  pool:
    vmImage: ubuntu-latest

  strategy:
    runOnce:
      deploy:
        steps:
        - download: buildpipeline
          artifact: helm-charts
        - bash: echo "Build run name was: $(resources.pipeline.buildpipeline.runName)"

I still think a worked example of CI & CD separated across two pipelines is badly needed in the docs

@benc-uk you're the man. Appreciate you documenting all this for the rest of us 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anlatsko picture anlatsko  ·  3Comments

Naphier picture Naphier  ·  3Comments

adnanebrahimi picture adnanebrahimi  ·  3Comments

sevaa picture sevaa  ·  3Comments

sandeepzgk picture sandeepzgk  ·  3Comments