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

manifests: add jenkins.yaml template #164

Merged
merged 1 commit into from
Dec 16, 2019
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Nov 22, 2019

There is this great plugin which I've somehow only learned about
recently to make Jenkins configuration much easier:

https://github.com/jenkinsci/configuration-as-code-plugin

The RHCOS pipeline already makes use of it.

To use this though, we need to be able to change the podspec of Jenkins
itself, which until now was embedded in the jenkins-persistent
template.

There's more though: I want to be able to define environment variables,
configmaps, secrets, etc... The default template doesn't provide
facilities for this.

So this patch essentially imports the template into our tree so that we
can have more control. The downside of course is that we lose updates to
the template. (Though that could also be seen as an upside too: we get
better reproducibility even if the template is upgrade.)

One convention I'm using is prefacing all the changes from the default
template values with a comment saying "DELTA:". That way, we can more
easily track what we added on top, and make rebasing easier in the
future.

Another advantage is that it makes setting it up easier because we don't
have to customize as many parameters: we can just set the right default
for us.

@jlebon jlebon marked this pull request as ready for review November 22, 2019 21:13
@jlebon
Copy link
Member Author

jlebon commented Nov 22, 2019

OK, this works fine! (Got another PR coming up which I'm almost done testing that works on top of this.)

@dustymabe
Copy link
Member

ok i'm working through testing this out (all the way to #166). One thing I'd like to consider (I do this occasionally) is to include the original file jenkins.yaml.org that is the original file along with a comment at the top about how it was created (where it came from). We should be able to periodically rebase by copying in a new jenkins.yaml.orig and then re-applying all the DELTAs on top of the new file. Keeping around the .orig is nice IMHO so we can vimdiff. Of course we can use git history for that, so I'll understand if this isn't something you think is valuable.

@jlebon
Copy link
Member Author

jlebon commented Dec 13, 2019

One thing I'd like to consider (I do this occasionally) is to include the original file jenkins.yaml.org that is the original file along with a comment at the top about how it was created (where it came from).

Sure, seems reasonable to me. It's really a shame there isn't a cleaner way to do this. I did chat with the OpenShift Jenkins folks to confirm there wasn't a more supported way.

That said, the upstream template doesn't change that often, so I think rebasing won't be too painful either.

There is this great plugin which I've somehow only learned about
recently to make Jenkins configuration much easier:

https://github.com/jenkinsci/configuration-as-code-plugin

The RHCOS pipeline already makes use of it.

To use this though, we need to be able to change the podspec of Jenkins
itself, which until now was embedded in the `jenkins-persistent`
template.

There's more though: I want to be able to define environment variables,
configmaps, secrets, etc... The default template doesn't provide
facilities for this.

So this patch essentially imports the template into our tree so that we
can have more control. The downside of course is that we lose updates to
the template. (Though that could also be seen as an upside too: we get
better reproducibility even if the template is upgrade.)

One convention I'm using is prefacing all the changes from the default
template values with a comment saying "DELTA:". That way, we can more
easily track what we added on top, and make rebasing easier in the
future.

Another advantage is that it makes setting it up easier because we don't
have to customize as many parameters: we can just set the right default
for us.
@jlebon
Copy link
Member Author

jlebon commented Dec 13, 2019

Done! ⬆️

Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@jlebon jlebon merged commit dea40d5 into coreos:master Dec 16, 2019
@jlebon jlebon deleted the pr/split-template branch December 16, 2019 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants