Hi all, I'm starting to use Pulumi as a pilot for ...
# getting-started
r
Hi all, I'm starting to use Pulumi as a pilot for our infrastructure. Would love some help with an issue please. It maybe a common rookie error. All good using the CLI and now creating an Azure Pipeline. Using the Pulumi@1 task There are 3 jobs. 1. Pulumi Preview 2. Manual Intervention 3. Pulumi Up The 1 and 2 work fine. The 'pulumi up', but it fails with...
Copy code
##[debug]   stack
##[debug]   select
##[debug]   myorganisation/bg/dev
/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi stack select myorganisation/bg/dev
##[debug]task result: Failed
##[error]Error: There was an error when attempting to execute the process '/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi'. This may indicate the process failed to start. Error: spawn /home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi ENOENT

##[debug]Processed: ##vso[task.issue type=error;]Error: There was an error when attempting to execute the process '/home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi'. This may indicate the process failed to start. Error: spawn /home/vsts/work/_temp/01d522e5-8d36-46cb-863b-4387991ea26a/pulumi/pulumi ENOENT
It looks like it fails on the 'select stack', but this is fine in the preview and is identical. The YAML looks like
Copy code
# Infrastructure Build and Deploy
variables:
  - template: /pipelines/variables/common-vars.yml
  - template: /pipelines/variables/bg/common-vars.yml
  - group: Core-Variables

trigger:
  batch: true
  branches:
    include:
    - main
  paths:
    include:
    - 'infrastructure/bg/**/*'

name: $(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

stages:

- stage: DEV
  displayName: Deploy to DEV

  variables:
    - template: /pipelines/variables/common-vars-dev.yml
    - template: /pipelines/variables/bg/dev-vars.yml
    - group: KeyVault-BG-Dev

  jobs:
    - job: PreviewInfra
      displayName: Pulumi Preview
      pool:
        vmImage: 'ubuntu-latest'
      steps:
          - task: NuGetToolInstaller@1
          - task: Pulumi@1
            condition: or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.Reason'], 'Manual'))
            inputs:
              azureSubscription: '${{ variables.AzureSubscriptionConnection }}'
              command: 'preview'
              cwd: '$(pulumiWorkingDirectory)'
              stack: '$(pulumiStackName)'
    - job: ManualIntervention
      dependsOn: PreviewInfra
      condition: and(succeeded('PreviewInfra'), ne(variables['Build.Reason'], 'PullRequest'))
      displayName: Manual Cross Check of Preview
      pool: server
      steps:
        - task: ManualValidation@0
          inputs:
            notifyUsers: '<mailto:me@somewhere.com|me@somewhere.com>'
            instructions: 'Cross check and Review the Pulumi Preview step and if appropriate approve.'
    - deployment: DeployInfra
      dependsOn: ManualIntervention
      displayName: Pulumi Up
      pool:
        vmImage: 'ubuntu-latest'
      environment: ${{ variables.DevOpsEnvName }}
      strategy:
        runOnce:
          deploy:
            steps:
            - task: NuGetToolInstaller@1
            - task: Pulumi@1
              inputs:
                azureSubscription: '${{ variables.AzureSubscriptionConnection }}'
                command: 'up'
                cwd: '$(pulumiWorkingDirectory)'
                stack: '$(pulumiStackName)'
                args: '--yes'