Skip to content

[JENKINS-55595] Configuration as code support#118

Open
Holmistr wants to merge 1 commit intojenkinsci:masterfrom
Holmistr:casc_support
Open

[JENKINS-55595] Configuration as code support#118
Holmistr wants to merge 1 commit intojenkinsci:masterfrom
Holmistr:casc_support

Conversation

@Holmistr
Copy link
Copy Markdown

https://issues.jenkins-ci.org/browse/JENKINS-55595

I had to change the list implementation because there was no configurator for CopyOnWriteList. Anyway, I don't see why it should be used, but perhaps I'm missing something. Feel free to point me to the right direction.

@darxriggs
Copy link
Copy Markdown

@Jimilian could you have a look at this?

@darxriggs
Copy link
Copy Markdown

darxriggs commented Apr 20, 2019

I suggest to also implement an import from YAML and export to YAML test.

See the official documentation for implementing these here.

@HardHero
Copy link
Copy Markdown

HardHero commented May 8, 2019

Not sure the status of this, but I would love to see this PR merged. Is there a timeline on for this project in merging all this stuff?

Trying to eliminate all the manual config setup for our Jenkins and this is one of the items on the list. So glad to see a solution waiting when I checked on here. 👍

Copy link
Copy Markdown
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

It is not going to work as is unfortunately. The persistency model is being changed without retaining compatibility. If the data type needs to be changes to make the code compatible with JCasC, there should be a graceful data migration imho

@Holmistr
Copy link
Copy Markdown
Author

Hi @oleg-nenashev , thanks for the feedback. Actually, I'm not sure how to proceed. Can you point me into the right direction?

@kpucynski
Copy link
Copy Markdown

In the meantime you can use workaround by writing initscript.
Here is example for jenkins helm chart:

  # List of groovy init scripts to be executed during Jenkins master start
  initScripts:
  #  - |
  #    print 'adding global pipeline libraries, register properties, bootstrap jobs...'
      s3-uploader: |
          import jenkins.model.*
          import hudson.plugins.s3.*
          
          instance  = Jenkins.instance
          new_name  = "s3"
          accessKey = "key"
          secretKey = "secret"
          useRole   = false
          S3Profile profile = new S3Profile(new_name, accessKey, secretKey, useRole, 60, "", "", "", "", false);
          
          publisher = hudson.plugins.s3.S3BucketPublisher
          des       = new hudson.plugins.s3.S3BucketPublisher.DescriptorImpl();
          s3Plugin  = instance.getDescriptor(S3BucketPublisher.class);
          
          new_profiles = [];
          des.getProfiles().each { if (it.name != new_name) { new_profiles.push(it) } }
          new_profiles.push(profile)
          
          s3Plugin.replaceProfiles(new_profiles)

@sanga
Copy link
Copy Markdown

sanga commented Jun 11, 2020

What's the status of this? The lack of casc support for this plugin is kind of a deal breaker for us.

@Holmistr
Copy link
Copy Markdown
Author

I'm still happy to do the changes, but to be honest I don't know what's needed.

@oleg-nenashev I have to admit that I didn't fully understand your comment. So you're saying that I cannot change the List implementation as it creates incompatibility. The reason I changed it was that there was no configurator for CopyOnWriteList. How difficult would it be to implement the configurator? Wouln't that be a preferred solution?

@oleg-nenashev oleg-nenashev self-requested a review June 12, 2020 07:58
@oleg-nenashev
Copy link
Copy Markdown
Member

Sorry, I missed your previous comment. Added it to my review queue

@Holmistr
Copy link
Copy Markdown
Author

No problem. I know that maintaining something is hard. Thanks for doing this! :)

@sanga
Copy link
Copy Markdown

sanga commented Aug 24, 2020

@Holmistr Just came here to check if there had been any progress on this and it appears you have a merge conflict here now

@Holmistr
Copy link
Copy Markdown
Author

@sanga I'm waiting for @oleg-nenashev 's answer on the comment #118 (comment) .

@mortenbirkelund
Copy link
Copy Markdown

@oleg-nenashev @Holmistr sorry for just tagging you guys, but was wondering if there is any updates?

@Holmistr
Copy link
Copy Markdown
Author

Unfortunately not from my side :-(

@HatsuneMiku3939
Copy link
Copy Markdown

Is there any update on this PR?

@Holmistr
Copy link
Copy Markdown
Author

@HatsuneMiku3939 Nothing from my side. I'm still happy to adapt the PR but I need some support from the Jenkins side. On the other hand, it's no longer a priority for me, so I'm not actively pushing for it. If you get the info "what should be done", I'm happy to do it :)

@HatsuneMiku3939
Copy link
Copy Markdown

HatsuneMiku3939 commented Oct 25, 2022

@Holmistr Thanks for your effort. I understand the current situation.

@stavros-k
Copy link
Copy Markdown

Sorry, I missed your previous comment. Added it to my review queue

Hello, how is the queue going? :)

In the mean time, is there a way to configure this using DSL? I can't find anything useful in JENKIKS_URL/plugin/job-dsl/api-viewer/index.html

Thanks!

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.

9 participants