Search code examples
azure-devopsazure-pipelinesazure-pipelines-yaml

Can't find the correct artifacts


I have a pipeline (MainPipeline) which triggers another one (DependantPipeline).

However my DependantPipeline can't read it, I suppose my mistake somewhere in one of the pipeline definitions.

The prepare.yml which might be useful here. I modified it a bit, this is how it looks like currently:

parameters:
  - name: pipelineOptions
    type: object
  - name: env
    type: string
  - name: region
    type: string
    default: $(region)
  - name: artifactStagingDirectory
    type: string
  - name: artifactName
    type: string
    default: terraform_src

steps:
  - task: DownloadPipelineArtifact@2
    displayName: "Download Terraform Sources"
    inputs:
      source: 'specific'
      project: $(resources.pipeline.SourcePipeline.projectName)
      pipeline: $(resources.pipeline.SourcePipeline.pipelineName)
      artifact: ${{parameters.artifactName}}
      runVersion: 'specific'
      runId: $(resources.pipeline.SourcePipeline.runID)
      path: '$(Pipeline.Workspace)/DetectChanges'
[...]

It leads to the error saying that cant find the proper file.

Would someone resolve me that issue? I can provide more yml definitions if needed.


Solution

  • It seems you're not downloading the artifacts that contains the terraform code - that's why you see errors like Given variables file xxxx.tfvars does not exist.

    For example, the following task will disable artifacts download:

      steps:
        - download: none
    

    Also, in prepare.yml the task DownloadPipelineArtifact@2 is commented out.

    Finally, please note that setting buildType: 'current' in DownloadPipelineArtifact@2 means that the task will try to download artifacts produced by the current pipeline.

    See Download artifacts from a specific project/pipeline or Download an artifact from a specific build run.