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

Added a generic method to create then run a pipeline based on the current method name #527

Merged
merged 4 commits into from Jul 2, 2019

Conversation

Vlatombe
Copy link
Member

@Vlatombe Vlatombe commented Jul 2, 2019

Resolves $NAME to the current name when used in the current pipeline script before running it. This makes the pipeline scripts more portable.

…rent method name

Resolves $NAME to the current name when used in the current pipeline script before running it. This makes the pipeline scripts more portable.
@Vlatombe Vlatombe requested a review from jglick July 2, 2019 11:34
@jglick jglick changed the title Added a generic method to create then run a pipeline based on the cur… Added a generic method to create then run a pipeline based on the current method name Jul 2, 2019
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for now. This idiom is not safe for concurrent builds—if the pod template in Jenkinsfile changes between builds, you could wind up running a build on the wrong node—but that is presumably not an issue in these tests. That problem is easily solved even for production pipelines by using, say,

podTemplate(label: BUILD_TAG/*, …*/) {
  node(BUILD_TAG) {
    //
  }
}

though this breaks for project names which are not legitimate Kubernetes names. I already have a plan to deal with that, JENKINS-57830, which could also be used for tests and thus supersede this when implemented.

@Vlatombe
Copy link
Member Author

Vlatombe commented Jul 2, 2019

Need to fix some remaining tests I didn't update w.r.t the changed groovy files

@Vlatombe Vlatombe merged commit 5cf7bf7 into jenkinsci:master Jul 2, 2019
@Vlatombe Vlatombe deleted the generic-pipelines branch July 2, 2019 13:18
@jglick
Copy link
Member

jglick commented Jul 2, 2019

Merged this into my own PRs (#461, #490, #503, #522). Build failures seem to be a proxy issue: INFRA-2164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants