4
votes

I'm looking at options of configuring Jenkins as code. What I've found so far are those two options:

What I don't understand yet is how those two work with each other? Do they both do the same and should I choose either one or another? Or maybe they do different things, in such case it would be great to know if those two can actually work together.

1
One is for configuring your Jenkins instances, the other is for configuring pipelines within them. They operate at different levels.jonrsharpe
Configuration as code plugin is used to configure your Jenkins after you setup/start a Jenkins master. With it you no need to configure Jenkins from the web UI: Jenkins -> Manage, instead you can prepare a YAML file then execute the YAML file, this plugin will do the configuration on Jenkins master. Pipeline is a kind of Jenkins Job, we use Jenkins job to execute repeat work for us, like build app deployment package from source code; run test script, etc. Therefor, Configuration as code plugin is way to config Jenkins, Pipeline is way to use Jenkins after you configured Jenkins.yong

1 Answers

3
votes

You can use pipeline to configure the build process as code.

You can use Jenkins Configuration as Code to configure the Jenkins instance as code.

You should also have a look at Job DSL Plugin to configure the jobs (everything but the build process) as code.

You may have a look at this repo to see it all work together: https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox