Deployment dependencies condition skipped azure pipeline

0 votes

I built a pipeline. There are two stages. The deployment stage job has a condition derived from the first stage variable. The sample pipeline is provided below.

pool:
  vmImage: 'ubuntu-latest'

stages:
- stage: Stage
  jobs:
  - deployment: Staging
    displayName: Stage the WebApp
    environment: stg
    strategy:
      runOnce:
        deploy:
          steps:
          - bash: echo "##vso[task.setvariable variable=myStageOutputVar;isOutput=true]true"
            env:
              myVar: 'this is a stage output var'
            name: printvar

- stage: Swap
  dependsOn: Stage
  condition: eq(dependencies.Stage.Staging.outputs['Staging.printvar.myStageOutputVar'], 'true')
  variables:
    myVarfromStage: $[ stageDependencies.Stage.Staging.outputs['Staging.printvar.myStageOutputVar'] ]
  jobs:
  - deployment: Production
    displayName: Swap to production
    environment: adt
    strategy:
      runOnce:
        deploy:
          steps:
          - script: echo $(myVarfromStage)

Every time, the Swap - stage is skipped. Any changes that must be made in the condition?

Jan 3, 2023 in DevOps on Cloud by Damonlang
• 1,230 points
1,341 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In DevOps on Cloud

0 votes
0 answers
0 votes
0 answers
0 votes
0 answers

Azure DevOps Build Pipeline - Exclude a Folder from Code Coverage

I'm trying to exclude a folder from the code coverage analysis, but I'm not having any luck despite a lot of trial and error and research on this site. This is my build pipeline test task: - task: DotNetCoreCLI@2 displayName: 'Running Unit ...READ MORE

Dec 19, 2022 in DevOps on Cloud by Damonlang
• 1,230 points
3,534 views
0 votes
0 answers
0 votes
0 answers
–1 vote
0 answers
0 votes
1 answer

Azure DevOps - Github status checks

To use the GitHub Status check, first ...READ MORE

answered Mar 25, 2022 in Azure by Edureka
• 13,620 points
1,060 views
0 votes
1 answer

How to collect DORA metrics for Azure DevOps (Server 2020) releases?

DORA measurements are provided by the DevOps ...READ MORE

answered Apr 1, 2022 in Azure by Edureka
• 12,690 points
1,283 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP