Ability to reference relative file for "jobs:" configuration
See original GitHub issueCurrent jobs:
looks like this:
jobs:
- script: >
multibranchPipelineJob('configuration-as-code') {
branchSources {
git {
id = 'configuration-as-code'
remote('https://github.com/jenkinsci/configuration-as-code-plugin.git')
}
}
}
I would much prefer to have it reference files.
jobs:
files:
- job1.groovy
- ./other/job2.groovy
I my experience, no seed job is quite as simple as the example. When attempting to migrate an existing server to JCASC one of my biggest stumbling blocks was converting/escaping/updating existing jobdsl. If jcasc supported loading of groovy files then I could almost just copy existing jobdsl and use it with almost zero effort on my part.
The advantage of this is that:
- remove the need for any escaping
- can use a groovy aware editor for jobdsl
- can easily test jobdsl in Jenkins or with other tools (without need for unescape/escape cycle
- greatly simplify migration to JCASC by allowing easy re-use of existing scripts.
Jenkins version: 2.156 Plugin version: 1.4 OS: docker:alpine
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
`.gitlab-ci.yml` keyword reference - GitLab Docs
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >How should software tools interpret relative paths in settings ...
Our current approach is to treat relative paths as being relative to the config file. This allows users to place a config file...
Read more >How To: Properly Use Relative Paths - Alteryx Community
The simplest way to set relative paths is to select your input/output files using absolute (full paths) file paths.
Read more >How to Provide References With a Job Application
Employers may ask for a list of references with a job application. Here's who to use and how to provide a reference list...
Read more >How To Create A Relative File Path In Power Query - Excel TV
Right click on the bottom of the worksheet and add a new tab. I recommend calling it Setup but you can also call...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
try:
*EDIT: the file has to be avaialbe to the jenkins master, I put it in $JENKINS_HOME. You can also use
- url: http://some/file.groovy
. Found this by reading the source insupport/src/main/java/io/jenkins/plugins/casc/support/jobdsl
; This could probably be documented in the jobs section of the demos.Seems to be documented here:
https://github.com/jenkinsci/job-dsl-plugin/wiki/JCasC
Does not work me when using the
jenkins/jenkins:2.235.1
Docker image.Apparently other people see this issue in https://github.com/jenkinsci/configuration-as-code-plugin/issues/1145#issuecomment-624077197 (closed issue)