jenkins-job-dsl

How do I filter out “Added a missed class for missing class telemetry” warnings when running the jenkins test harness?

こ雲淡風輕ζ 提交于 2020-08-10 22:30:46
问题 Im using the jenkins test harness (starting with this example usage: https://github.com/testcookbook/jenkins_harness) and this warning is killing me Was this fixed? I tried following the issues but its left me more confused. I just want to NOT see it in my output: https://issues.jenkins-ci.org/browse/JENKINS-60725?page=com.atlassian.jira.plugin.system.issuetabpanels%3Achangehistory-tabpanel, https://issues.jenkins-ci.org/browse/JENKINS-60725, https://issues.jenkins-ci.org/browse/JENKINS-60725

Sparse Checkout with Jenkins DSL Plugin?

会有一股神秘感。 提交于 2020-01-23 12:59:51
问题 Does anyone have a code sample for the correct configure { ... } block needed in the Jenkins DSL plugin to set up a git sparse checkout? It appears as if the config.xml section looks like this: <extensions> <hudson.plugins.git.extensions.impl.CloneOption> <shallow>false</shallow> <reference>/build/jenkins/codebase.git</reference> </hudson.plugins.git.extensions.impl.CloneOption> <hudson.plugins.git.extensions.impl.SparseCheckoutPaths> <sparseCheckoutPaths> <hudson.plugins.git.extensions.impl

Execute Jenkins Pipeline from inside DSL

让人想犯罪 __ 提交于 2020-01-15 11:35:28
问题 I do have a pipeline, p1, configured with 3 parameters, param1 as ChoiceParam, and param2 and param3 as runParameters, that retrieve different build-ids to pass them as versions. I do also have annother pipeline, p2, from which i'd like to run p1. p2 does also have the same parameters configured, so, inside the dsl, i need to call p1 with params1,params2,params3 , as params should be inherited in p2 But i'm unable, as i've tried any single way i can think of. Can anyone help me ? p2: build()

Jenkins' JobDSL Queue with Parameters

匆匆过客 提交于 2020-01-15 10:25:13
问题 Does anyone know if you can run a Jenkins' job from JobDSL that has parameters? I have used queue https://jenkinsci.github.io/job-dsl-plugin/#path/queue But according to the docs, it only accepts a string or Job object. Maybe there is a way to do it with Job object, but its not clear. From JobDSL docs: def example1 = job('example-1') { displayName('first example') } queue(example1) job('example-2') { displayName('second example') } queue('example-2') 回答1: Have same problem and couldn't find

Create a file with some content using Groovy in Jenkins pipeline

限于喜欢 提交于 2020-01-13 07:36:09
问题 I am trying to create a file called groovy1.txt with the content "Working with files the Groovy way is easy." Note: I don't want to use the shell to create this file, instead I want to use Groovy to achieve this. I have following script in my Jenkins pipeline. node { def file1 = new File('groovy1.txt') file1.write 'Working with files the Groovy way is easy.\n' sh 'ls -l' // Expecting the file groovy1.txt should present with the content mentioned above } But it is throwing FileNotFound

Jenkins Job DSL - load groovy library from git repo

混江龙づ霸主 提交于 2020-01-07 05:22:05
问题 I want to keep my seed job as small as possible and keep all the logic in a central git repository. Also, I have several independent Jenkins instances that then could share the code. How can I load a groovy library in a Jenkins Job DSL script? Is there something like the Pipeline Remote File Loader Plugin, so that you only need to do fileLoader.fromGit('lib.groovy', 'https://git.repo') ? 回答1: Hereafter my quicksheet about achieving this in a parameterized Pipeline job, Using Pipeline script

loop over array of jobs to create them?

▼魔方 西西 提交于 2020-01-06 06:24:13
问题 I have the dsl job configured to delete unreferenced jobs and i want to keep that: Im trying to do this: def bitbucket_team = 'myteam' def bitbucket_user = 'mycreds' def repo_arr = ['job1','job2'] repo_arr.collect { repo -> println "${repo}" multibranchPipelineJob("${repo}") { configure { it / sources / data / 'jenkins.branch.BranchSource' / source(class: 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource') { credentialsId("${bitbucket_user}") //checkoutCredentialsId('bitbucket-ssh

Start jenkins job immediately after creation by seed job

心不动则不痛 提交于 2020-01-02 00:58:07
问题 I'm using the Jenkins DSL plugin to automatically create build jobs for all branches of a git project. The DSL plugin is triggered by web hooks so that it is run immediately after a new branch was created. The generated build jobs for each branch are also configured to be triggered by web hooks. The problem with the current setup is, that the build will only be executed after the second commit. The first commit will trigger the Jenkins DSL plugin to create the respective Jenkins Job and the