-2

I am trying to workout the directory on the Hosted VM where plan.out would be saved and so I can publish, I tired the below but the publish task failed with error...

"Error... ##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: /home/vsts/work/1/s/test/plan.out"

I guess its which folder path does the 'plan.out' file get placed on the VM the pipeline runs on..?

 - task: TerraformTaskV4@4
        enabled: true
        displayName: 'Terraform : PLAN'
        inputs:
          provider: 'azurerm'
          command: 'plan'
          workingDirectory: '$(System.DefaultWorkingDirectory)/$(env)'
          commandOptions: '-lock=false -out=plan.out -var "env=$(env)" -var "prefix=$(application-code-prefix)" -var "agentVmIpAddress=[\"$(ipaddressVar)\"]" -var "vnet_address_space=$(vnet-cidr)"'
          environmentServiceNameAzureRM: 'spDeployment_ISL-LDS-Test'

      - task: PublishBuildArtifacts@1
        enabled: true
        displayName: 'Publish Terraform Plan'
        inputs:
          PathtoPublish: '$(Pipeline.Workspace)/s/$(env)/*plan.out*'
          ArtifactName: 'Terraform Plan'
Ian Carrick
  • 242
  • 3
  • 18

1 Answers1

0

The TF plan file is ouput to the same working directory as set in the Terraform Plan step, in this case...

$(System.DefaultWorkingDirectory)/$(env)

Ian Carrick
  • 242
  • 3
  • 18