Reputation: 328
I have values.yaml that is working perfectly.
I would like to add Jcasc Config Yml to automatically add pipelines but cannot find the format for the values.yml file.
Currently I have below and would like to reference Jenkins.yaml
JCasC:
enabled: true
pluginVersion: 1.35
configScripts:
welcome-message: |
jenkins:
systemMessage: Welcome to our CI\CD server. This Jenkins is configured and managed 'as code'.
What should I put for the configScripts:
section ? just configScripts: ./jenkins.yaml
?
Upvotes: 3
Views: 2207
Reputation: 21
You can also use the job DSL
plugin which allows you to pass a Jenkins pipeline in a cleaner looking fashion. Your code would look like this:
installPlugins:
... << all your other plugins >>
- job-dsl:1.77
...
JCasC:
configScripts:
base-config: |-
... << your other plugin config >>
jobs:
- script: >
pipelineJob('unit-tests') {
<< your pipeline config >>
}
...
Check out the example in JCasC demo. One more thing to add, once you've added the jobDSL plugin there's an API endpoint available on your Jenkins implementation at: https://your-jenkins-url/plugin/job-dsl/api-viewer/index.html, it provides detailed description of all the params you can set for each jobDSL method.
Upvotes: 2
Reputation: 328
was able to add as job like below,
jobs:
Test-Job: |-
<?xml version='1.0' encoding='UTF-8'?>
<project>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<canRoam>false</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders/>
<publishers/>
<buildWrappers/>
</project>
Upvotes: 1