jenkins-build-flow

Access files on a node slave from Jenkins master using Groovy

冷暖自知 提交于 2020-01-01 10:16:12
问题 I am using the Jenkins Build Flow plugin to achieve parallelization. The Groovy DSL does certain file operations. Even though the option Restrict where this project can be run is set to run the job on a specific slave, the DSL runs on master. This is not intended. Could someone tell me how I can restrict the DSL to run on the specified slave? Even if there is a way we can access the slave file system via the DSL, that should work. In general, how can we access files on a node slave from

Jenkins Build Flow versus Workflow (Pipeline) plugin

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 07:46:04
问题 I notice there are (at least) two orchestration options for Jenkins Build Flow Workflow - Now known as Pipeline I found Build Flow first and implemented an orchestration job around that which seems to work OK for our needs. Are there any advantages to switching to Pipeline? My thoughts for switching to Pipeline are Pro - The project seems more active than Build Flow Con - The DSL seems much more complex 回答1: Pipeline / Workflow is based off concepts from the Build Flow plugin. Based on the

How can I trigger a Jenkins job upon completion of a set of other jobs?

﹥>﹥吖頭↗ 提交于 2019-12-12 13:15:32
问题 The simple case where you just have one job depending on the completion of a set of other jobs is easy: either use a multijob or use the build flow plugin with parallel { ... } . The case I am trying to solve is more general, for example: JobA depends on JobX and JobZ JobB depends on JobY and JobZ SuperJob depends on JobA and JobB I want each of these jobs to trigger as soon as, and only when their prerequisites complete. It would appear that neither the build flow plugin, nor the join plugin

Access files on a node slave from Jenkins master using Groovy

一曲冷凌霜 提交于 2019-12-04 07:43:47
I am using the Jenkins Build Flow plugin to achieve parallelization. The Groovy DSL does certain file operations. Even though the option Restrict where this project can be run is set to run the job on a specific slave, the DSL runs on master. This is not intended. Could someone tell me how I can restrict the DSL to run on the specified slave? Even if there is a way we can access the slave file system via the DSL, that should work. In general, how can we access files on a node slave from Jenkins master using Groovy? def fp = new hudson.FilePath(build.workspace.channel, "/srv/jenkins/workspace

Parallel jobs using build flow plugin with loop in jenkins

…衆ロ難τιáo~ 提交于 2019-12-03 22:22:37
问题 I am building a jenkins flow using the build flow plugin that will grab all of the jobs, compare the name to a regex, and if it matches it will trigger a build of the job. I have this working perfectly: import jenkins.model.Jenkins import java.util.regex.* Pattern myRegex = ~/release_status.*/ for (item in jenkins.model.Jenkins.instance.items) { if (item.name ==~ myRegex) { build( "$item.name" ) } } However this takes a very long time to build all of the matching jobs (right now there are 20

Parallel jobs using build flow plugin with loop in jenkins

心已入冬 提交于 2019-12-01 01:20:41
I am building a jenkins flow using the build flow plugin that will grab all of the jobs, compare the name to a regex, and if it matches it will trigger a build of the job. I have this working perfectly: import jenkins.model.Jenkins import java.util.regex.* Pattern myRegex = ~/release_status.*/ for (item in jenkins.model.Jenkins.instance.items) { if (item.name ==~ myRegex) { build( "$item.name" ) } } However this takes a very long time to build all of the matching jobs (right now there are 20 but there could be many more). I am trying to make this run each job in parallel but I can't figure out

How to fix NotSerializableException error during Jenkins workflow build?

≡放荡痞女 提交于 2019-11-29 03:23:51
When I run the following code on the Jenkins workflow (Jenkins 1.609.1 ,workflow 1.8) I get error of 'NotSerializableException' (also below). However, if I move the "build job" outside the "for" scope it works fine (the job is activated). Any ideas why this behavior? node('master') { ws('/opt/test) { def file = "/ot.property" def line = readFile (file) def resultList = line.tokenize() for(item in resultList ) { build job: 'testjob_1' } } } Got error: Running: End of Workflow java.io.NotSerializableException: java.util.ArrayList$Itr at org.jboss.marshalling.river.RiverMarshaller.doWriteObject

How do I make Jenkins build fail when Maven unit tests fail?

放肆的年华 提交于 2019-11-28 06:42:16
I'm using Jenkins, Maven 3.1, and Java 1.6. I have the following Maven job set up in Jenkins with the following goals and options ... clean install -U -P cloudbees -P qa below is my pom.xml surefire configuration ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <reuseForks>true</reuseForks> <argLine>-Xmx2048m -XX:MaxPermSize=512M </argLine> <skipTests>false</skipTests> </configuration> </plugin> However, when my unit tests fail, the Jenkins console output still says "BUILD SUCCESS" and the build is

How to fix NotSerializableException error during Jenkins workflow build?

末鹿安然 提交于 2019-11-27 17:44:26
问题 When I run the following code on the Jenkins workflow (Jenkins 1.609.1 ,workflow 1.8) I get error of 'NotSerializableException' (also below). However, if I move the "build job" outside the "for" scope it works fine (the job is activated). Any ideas why this behavior? node('master') { ws('/opt/test) { def file = "/ot.property" def line = readFile (file) def resultList = line.tokenize() for(item in resultList ) { build job: 'testjob_1' } } } Got error: Running: End of Workflow java.io

How do I make Jenkins build fail when Maven unit tests fail?

筅森魡賤 提交于 2019-11-27 01:27:01
问题 I'm using Jenkins, Maven 3.1, and Java 1.6. I have the following Maven job set up in Jenkins with the following goals and options ... clean install -U -P cloudbees -P qa below is my pom.xml surefire configuration ... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.17</version> <configuration> <reuseForks>true</reuseForks> <argLine>-Xmx2048m -XX:MaxPermSize=512M </argLine> <skipTests>false</skipTests> </configuration> </plugin>