简体   繁体   中英

Azure Devops Pipeline

Need a small help , can someone point me what is the issue here .

What i am trying to achieve , the pipeline has to run checkout irrespective of the branch i am in , but in the build stage if the pipeline run from master it has execute some templet if from other branch different templet , i tried many option no luck .

Any pointer much appreciated .

  - stage: Checkout
    displayName: Micro Service checkout and Secrets
    jobs:
    - job:
      steps:
      - template: templates/repocheckout.yml@azureTemplates

      - template: templates/retrieving_secrets.yml@azureTemplates

      - template: templates/Ingesting_secrets.yml@azureTemplates
      
  - stage: Build
    displayName: Microservice Build
    jobs:
    - job: Master
      condition: eq(variables['Build.SourceBranchName'], 'master') 
      steps:
      - template: templates/mavenbuild_new.yml@azureTemplates
      - template: templates/push_artifact_jfrog.yml@azureTemplates
        parameters:
          service_name: '$(countryCode)-$(servicename)'
          release_version: $(release)   
          
    - job: Develop
      dependsOn: Master
      condition: eq(variables['Build.SourceBranchName'], 'develop')
      steps:
      - template: templates/mavenbuild.yml@azureTemplates
      - template: templates/push_artifact_jfrog.yml@azureTemplates
        parameters:
          service_name: '$(countryCode)-$(servicename)'
          release_version: $(release)   

This doesn't look like valid yaml.

阶段 yaml

Have a look at this: https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema

It looks like you are missing this at the top of the file:

stages:

ie your yaml should be:

 stages: - stage: Checkout displayName: Micro Service checkout and Secrets jobs:

etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM