Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass variables from Build pipeline to Release #609

Closed
sjdhanasekaran opened this issue Apr 30, 2024 · 2 comments
Closed

Pass variables from Build pipeline to Release #609

sjdhanasekaran opened this issue Apr 30, 2024 · 2 comments
Assignees

Comments

@sjdhanasekaran
Copy link

I have traced many articles but not getting clear idea.

I am using azure build pipeline to set a variables and consume the same variable in azure releases by point the build as artifact in releases.

trigger:
  - base

pool:
  name: Default

steps:
  - checkout: self
    persistCredentials: true

  - task: Bash@3
    displayName: "SetVer"
    name: "SetVer"
    enabled: true
    inputs:
      targetType: "inline"
      script: |
        echo "##vso[task.setvariable variable=baseImageTag;isOutput=true]1.0.0"

  - task: Bash@3
    displayName: "printVer"
    enabled: true
    inputs:
      targetType: "inline"
      script: |
        echo "echoinggg"
        echo $(SetVer.baseImageTag)

in the second task i am able to consume the baseImageTag but the same variable i am not able to consume in releases.

Thanks all

@ivanduplenskikh
Copy link

Hi @sjdhanasekaran,
The values of pipeline variables can vary between different runs or jobs as it stated in the documentation

The value of a variable can change from run to run or job to job of your pipeline.

If you're using a release pipeline, therefore you have no access to YAML pipeline's variables and their values.

If you need to use a pipeline variable, you may use another deployment strategy, such as defining a deployment stage in a YAML pipeline

@ivanduplenskikh ivanduplenskikh self-assigned this May 9, 2024
@sjdhanasekaran
Copy link
Author

@ivanduplenskikh Clear. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants