Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulumi extension task fails when ran as part of a deployment #91

Closed
tap1992 opened this issue Jan 14, 2022 · 3 comments
Closed

Pulumi extension task fails when ran as part of a deployment #91

tap1992 opened this issue Jan 14, 2022 · 3 comments
Assignees
Labels
awaiting-feedback Blocked on input from the author awaiting-feedback-stale Blocked on input from the author and hasn't been updated in 14 days kind/question Questions about existing features resolution/no-repro This issue wasn't able to be reproduced

Comments

@tap1992
Copy link

tap1992 commented Jan 14, 2022

Describe the bug

Using the Pulumi Azure DevOps extension's task within a deployment job it fails with the below error. If i copy and paste the same task into a normal job it works perfectly fine.

##[error]Error: There was an error when attempting to execute the process '/__w/_temp/c0162cb7-b00c-44f7-a09c-82bb8eefcc6a/pulumi/pulumi'. This may indicate the process failed to start. Error: spawn /__w/_temp/c0162cb7-b00c-44f7-a09c-82bb8eefcc6a/pulumi/pulumi ENOENT

To Reproduce

Using YAML pipelines, use a normal job with steps and utilise the pulumi task as shown below:
jobs:

  • job: test
    steps:
    • task: Pulumi@1
      inputs:
      azureSubscription: ***
      command: 'preview'
      cwd: ''
      stack: '
      '
      args: '--diff'
      loginArgs: azblob://***

It should work as normal.
If we use the deployment version of a job as per below it will fail:

  • deployment: deploy_job
    environment: ***
    workspace:
    clean: all
    strategy:
    runOnce:
    deploy:
    steps:
    - task: Pulumi@1
    inputs:
    azureSubscription: ***
    command: 'preview'
    cwd: ''
    stack: '
    '
    args: '--diff'
    loginArgs: azblob://***

Expected behavior

Pulumi preview should run and generate the output in logs.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@praneetloke
Copy link
Contributor

It seems that you will need to include a step to checkout the source code in your deployment job since they do not automatically clone the source repo. See https://docs.microsoft.com/en-us/azure/devops/pipelines/process/deployment-jobs?view=azure-devops.

A deployment job doesn't automatically clone the source repo. You can checkout the source repo within your job with checkout: self. Deployment jobs only support one checkout step.

deploy:
  steps:
    # Add this step before running Pulumi.
    - checkout: self

    - task: Pulumi@1
      inputs:
        azureSubscription: ***
        command: 'preview'
        cwd: ''
        stack: ''
        args: '--diff'
        loginArgs: azblob://***

@praneetloke
Copy link
Contributor

@tap1992 are you still encountering a problem using the task extension?

@praneetloke praneetloke added the awaiting-feedback-stale Blocked on input from the author and hasn't been updated in 14 days label Jan 26, 2022
@leezen leezen added the awaiting-feedback Blocked on input from the author label Feb 4, 2022
@MartynFewtrell
Copy link

Thanks All - Adding the "- checkout: self" fixed it!

@justinvp justinvp added resolution/no-repro This issue wasn't able to be reproduced kind/question Questions about existing features labels Jul 18, 2023
@justinvp justinvp self-assigned this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author awaiting-feedback-stale Blocked on input from the author and hasn't been updated in 14 days kind/question Questions about existing features resolution/no-repro This issue wasn't able to be reproduced
Projects
None yet
Development

No branches or pull requests

5 participants