[JIRA] (JENKINS-59037) Environment from CasC yaml to job dsl script

3 views
Skip to first unread message

sk_rw@yahoo.com (JIRA)

unread,
Aug 21, 2019, 5:25:02 PM8/21/19
to jenkinsc...@googlegroups.com
Rudolf-Walter Kiss-Szakacs created an issue
 
Jenkins / Improvement JENKINS-59037
Environment from CasC yaml to job dsl script
Issue Type: Improvement Improvement
Assignee: Daniel Spilker
Components: job-dsl-plugin
Created: 2019-08-21 21:24
Labels: configuration-as-code
Priority: Minor Minor
Reporter: Rudolf-Walter Kiss-Szakacs

When executing job dsl scripts from configuration-as-code, there should be a way to pass values from the yaml files into the job dsl groovy.

This would be useful in cases where one wishes to generate the same jobs from CasC on multiple masters, with minor variations.

Example:

common_jobs.groovy
job('awesome-job') {
	description("favorite job of ${SUPERHERO}")
}
master_one.yml
jobs:
  - providedEnv:
      SUPERHERO: 'Wonder Woman'
  - file: common_jobs.groovy
master_two.yml
jobs: 
  - providedEnv:
      SUPERHERO: 'Midnighter'
  - file: common_jobs.groovy

Alternatively, one could set an environment variable on the host VM/container of Jenkins. Depending on the setup, that can be inconvenient to do. Also, that variable would unnecessarily pollute the environment of every job etc.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

mail@daniel-spilker.com (JIRA)

unread,
Aug 22, 2019, 8:34:02 AM8/22/19
to jenkinsc...@googlegroups.com
Daniel Spilker resolved as Fixed
Change By: Daniel Spilker
Status: Open Resolved
Resolution: Fixed
Released As: job-dsl 1.76

mail@daniel-spilker.com (JIRA)

unread,
Mar 11, 2020, 8:54:02 AM3/11/20
to jenkinsc...@googlegroups.com
Daniel Spilker closed an issue as Fixed
Change By: Daniel Spilker
Status: Resolved Closed
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages