Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Helm format for master.JCasC.configScripts

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 ?

like image 318
DeclanG Avatar asked Apr 01 '26 02:04

DeclanG


1 Answers

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.

like image 61
Taneisha Avatar answered Apr 03 '26 18:04

Taneisha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!