configuration-as-code-plugin | Jenkins Configuration as Code Plugin | Plugin library
kandi X-RAY | configuration-as-code-plugin Summary
kandi X-RAY | configuration-as-code-plugin Summary
Setting up Jenkins is a complex process, as both Jenkins and its plugins require some tuning and configuration, with dozens of parameters to set within the web UI manage section. Experienced Jenkins users rely on groovy init scripts to customize Jenkins and enforce the desired state. Those scripts directly invoke Jenkins API and, as such, can do everything (at your own risk). But they also require you to know Jenkins internals and are confident in writing groovy scripts on top of Jenkins API. The Configuration as Code plugin is an opinionated way to configure Jenkins based on human-readable declarative configuration files. Writing such a file should be feasible without being a Jenkins expert, just translating into code a configuration process one is used to executing in the web UI. The below configuration file includes root entries for various components of your primary Jenkins installation. The jenkins one is for the root Jenkins object, and the other ones are for different global configuration elements. Additionally, we want to have a well-documented syntax file and tooling to assist in writing and testing, so end users have full guidance in using this toolset and do not have to search for examples on the Internet. See the presentation slides from DevOps World - Jenkins World 2018 for an overview.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Exports the schema to a URL
- Generate JSON object for non - enum attributes
- Generate a JSON representation of a helo descriptor object
- Generates the schema
- Export the JVM
- Serializes a YAML node to a writer
- Serialize a configuration object to YAML
- Exports the configuration to an output stream
- Get a list of registered elements
- Handles a new source
- Provides list of available attributes
- Create a new instance for the given CNode
- Describe the structure
- Replace source
- Describe the given descriptor
- Checks for issues
- Initialize secrets
- Provides description of this plugin
- Gets a Field object by name
- Reload configuration
- Resolves the given variable
- Export the live jenkins instance as yaml
- Gets user
- Overriding superclass method
- Get the given instance
- Describe the given instance
configuration-as-code-plugin Key Features
configuration-as-code-plugin Examples and Code Snippets
Community Discussions
Trending Discussions on configuration-as-code-plugin
QUESTION
I'm moving a Jenkins from 'traditional' to JCasC. We have a quite complex setup already, and I am wondering if there is a way to migrate somehow the current configuration without a need of going through settings and code it in .yaml?
btw. I'm not sure about installing JCasC plugin on prod to see the configuration... Am I wrong?
Thanks!
...ANSWER
Answered 2021-Jan-20 at 09:27Make sure to have read the Getting Started and other docs.
Create new instance (you can do this onto your desktop/laptop) and copy over all the configuration, config.xml,*.xml, secrets and keys, but NO jobs into the new instance. See what to backup.
Add an entry to start in quiet mode by adding Jenkins.instance.doQuietDown()
You might want/need to change the url and port config too.depending on host. Mind you, you can do this all onto your desktop/laptop
Copy the plugins as well. Add the config as code plugin.
Startup the new instance, export the CasC config and review. The export is a starting point so fill in any missing gaps, etc. For example, since you did not copy jobs over, folders and views will not be created. Some plugin configs are.also not yet implemented.
Stop Jenkins, delete all the config (except the secret key). Put the JCasC config in place and start up. Compare the new configs to what you backed up/copied over. Repeat until they match. Now you should have a config that matches Prod.
Now you can install JCasc in Prod. The plugin does nothing until configured. But do a similar backup/compare of Prod config, before and after the config, just in case something changed in the intervening period
Of course, now you need to mke sure any changes are now only done via JCasC and not the UI, or you are out of sync again. See blog and JEP.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install configuration-as-code-plugin
Those running Jenkins as a Docker container (and maybe also pre-installing plugins), do include Configuration as Code plugin.
Path to a folder containing a set of config files. For example, /var/jenkins_home/casc_configs.
A full path to a single file. For example, /var/jenkins_home/casc_configs/jenkins.yaml.
A URL pointing to a file served on the web. For example, https://acme.org/jenkins.yaml.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page