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

Declarative Agent Declaration Skips Default Checkout #94

Closed
ghost opened this issue May 1, 2019 · 3 comments
Closed

Declarative Agent Declaration Skips Default Checkout #94

ghost opened this issue May 1, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented May 1, 2019

It appears that when defining an agent using the declarative syntax, the default checkout functionality that comes with declarative pipelines is disabled.

I suspect the issue might be in com.cloudbees.jenkins.plugins.amazonecs.pipeline.ECSDeclarativeAgentScript but can't be certain. That class appears to import org.jenkinsci.plugins.pipeline.modeldefinition.agent.CheckoutScript but does not do anything with it.

There is a simple enough workaround (explicitly disable default checkout and add a checkout stage):

pipeline {
  agent {
    ecs {
      inheritFrom 'my-base-agent-label'
      label 'my-custom-agent-label'
    }
  }

  options {
    skipDefaultCheckout()
  }

  stages {
    stage ('Checkout') {
      steps {
        checkout scm
      }
    }

    ...more stages for the pipeline...

  }
}

Obviously it would be preferred though if the default checkout functionality was preserved when using a declarative definition for an ECS agent.

@pgarbe
Copy link
Contributor

pgarbe commented May 3, 2019

Thanks for reporting.

I guess that CheckoutScript.doCheckout(script, describable, describable.customWorkspace) is missing inside the script.node() block

@webratz
Copy link
Contributor

webratz commented Jul 3, 2019

There should be a beta of 1.21 in the next few minutes maybe you can check if its still there. i remember there were some changes

@mdouglass
Copy link
Contributor

Looks like 1.21 beta did not fix it, I have sent PR #115 to address it

@mdouglass mdouglass mentioned this issue Jul 3, 2019
webratz added a commit that referenced this issue Jul 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants