Build Flow Plugin

Skip to end of metadata
Go to start of metadata

Plugin Information

Plugin ID build-flow-plugin Changes In Latest Release
Since Latest Release
Latest Release
Latest Release Date
Required Core
Dependencies
0.11.1
Apr 08, 2014
1.480
buildgraph-view (version:1.0)
Source Code
Issue Tracking
Maintainer(s)
GitHub
Open Issues
Nicolas De Loof (id: ndeloof)
Julien Henry (id: henryju)
Mathieu Ancelin (id: mathieuancelin)
Dimitri Baeli (id: dbaeli)
Usage Installations 2013-Apr 1660
2013-May 1809
2013-Jun 1932
2013-Jul 2123
2013-Aug 2200
2013-Sep 2287
2013-Oct 2535
2013-Nov 2666
2013-Dec 2774
2014-Jan 2928
2014-Feb 3159
2014-Mar 3408

This plugin allows managing Jenkins jobs orchestration using a dedicated DSL, extracting the flow logic from jobs.

 Summary

This plugin is designed to handle complex build workflows (aka build pipelines) as a dedicated entity in Jenkins. Without such a plugin, to manage job orchestration the user has to combine parameterized-build, join, downstream-ext and a few more plugins, polluting the job configuration. The build process is then scattered in all those jobs and very complex to maintain. Build Flow enables you to define an upper level Flow item to manage job orchestration and link up rules, using a dedicated DSL. This DSL makes the flow definition very concise and readable.

Configuration

After installing the plugin, you'll get a new Entry in the job creation wizard to create a Flow. Use the DSL editor to define the flow.

Basics

The DSL defines the sequence of jobs to be built :

build( "job1" )
build( "job2" )
build( "job3" )

You can pass parameters to jobs, and get the resulting AbstractBuild when required :

b = build( "job1", param1: "foo", param2: "bar" )
build( "job2", param1: b.build.number )

Environment variables from a job can be obtained using the following, which is especially useful for getting things like the checkout revision used by the SCM plugin ('P4_CHANGELIST', 'GIT_REVISION', etc) :

def revision = b.environment.get( "GIT_REVISION" )

You can also access some pre-defined variables in the DSL :

  • "build" the current flow execution
  • "out" the flow build console
  • "env" the flow environment, as a Map
  • "params" triggered parameters
  • "upstream" the upstream job, assuming the flow has been triggered as a downstream job for another job.

For example:

// output values
out.println 'Triggered Parameters Map:'
out.println params
out.println 'Build Object Properties:'
build.properties.each { out.println "$it.key -> $it.value" }

// use it in the flow
build("job1", parent_param1: params["param1"])
build("job2", parent_workspace:build.workspace)

Guard / Rescue

You may need to run a cleanup job after a job (or set of jobs) whenever they succeeded or not. The guard/rescue structure is designed for this use-case. It works mostly like a try+finally block in Java language :

guard {
    build( "this_job_may_fail" )
} rescue {
    build( "cleanup" )
}

The flow result will then be the worst of the guarded job(s) result and the rescue ones

Ignore

You may also want to just ignore result of some job, that are optional for your build flow. You can use ignore block for this purpose :

ignore(FAILURE) {
    build( "send_twitter_notification" )
}

The flow will not take care of the triggered build status if it's better than the configured result. This allows you to ignore UNSTABLE < FAILURE < ABORTED

Retry

You can ask the flow to retry a job a few times until success. This is equivalent to the retry-failed-job plugin :

retry ( 3 ) {
    build( "this_job_may_fail" )
}

Parallel

The flow is strictly sequential, but let you run a set of jobs in parallel and wait for completion. This is equivalent to the join plugin :

parallel (
    // job 1, 2 and 3 will be scheduled in parallel.
    { build("job1") },
    { build("job2") },
    { build("job3") }
)
// job4 will be triggered after jobs 1, 2 and 3 complete
build("job4")

compared to join plugin, parallel can be used for more complex workflows where the parallel branches can sequentially chain multiple jobs :

parallel (
    {
        build("job1A")
        build("job1B")
        build("job1C")
    },
    {
        build("job2A")
        build("job2B")
        build("job2C")
    }
)

you also can "name" parallel executions, so you can later use reference to extract parameters / status :

join = parallel ([
        first:  { build("job1") },
        second: { build("job2") },
        third:  { build("job3") }
])

// now, use results from parallel execution
build("job4",
       param1: join.first.result.name,
       param2: join.second.lastBuild.parent.name)

and this can be combined with other orchestration keywords :

parallel (
    {
        guard {
            build("job1A")
        } rescue {
            build("job1B")
        }
    },
    {
        retry 3, {
            build("job2")
        }
    }
)

Extension Point

Other plugins that expose themselves to the build flow can be accessed with extension.'plugin-name'

So the plugin foobar might be accessed like:

def x = extension.'my-plugin-name'
x.aMethodOnFoobarObject()

Implementing Extension

Write the extension in your plugin

@Extension(optional = true)
public class MyBuildFlowDslExtension extends BuildFlowDSLExtension {

    /**
     * The extensionName to use for the extension.
     */
    public static final String EXTENSION_NAME = "my-plugin-name";

    @Override
    public Object createExtension(String extensionName, FlowDelegate dsl) {
        if (EXTENSION_NAME.equals(extensionName)) {
            return new MyBuildFlowDsl(dsl);
        }
        return null;
    }
}

Write the actual extension

public class MyBuildFlowDsl {
    private FlowDelegate dsl;

    /**
     * Standard constructor.
     * @param dsl the delegate.
     */
    public MyBuildFlowDsl(FlowDelegate dsl) {
        this.dsl = dsl;
    }

    /**
     * World.
     */
    public void hello() {
        ((PrintStream)dsl.getOut()).println("Hello World");
    }

}

And more ...

future releases may introduce support for some more features and DSL syntax for advanced job orchestration.

Usage

As any Job, the Flow is executed by a trigger, and the Cause is exposed to the flow DSL. If you want to implement a build-pipeline after a commit on your scm, you can configure the flow to be triggered as the first scm-polling job is run, but you can as well use any other trigger (manual trigger, XTrigger plugin, ...) for your flow to integrate in a larger process.

Roadmap

JENKINS-16980 major issue to prevent releasing a 1.0 version : build-flow require RUN-SCRIPT permission as it allows to run arbitrary code on master (so bypassing security). Need to setup some sandboxing / security manager to allow editing the DSL with lower permission. Possibly using groovy sandbox, maybe require a more general purpose SecurityManager. Such a component would be useful for all other groovy-related plugins.

JENKINS-19118 make DSL resumable : implementation will probably have significant impact on DSL execution engine. My current plan is to allow the DSL to be executed multiple times, previously-executed "build()" invocation being No-Op. This assumes groovy scripting in DSL is strictly idempotent.

With those two issues in mind, preferred way to add new keyword to DSL is to define an extension in a dedicated plugin.

Need help ?

Please don't enlarge even more this page comment list, that we hardly can follow. Join jenkins-user mailing list and explain your use-case there

Changelog

Work in Progress

0.11.1

  • no changes (added the compatibility warning to update center)

0.11 (released Apr. 8, 2014)

  • plugin re-licensed to MIT
  • build flow no longer has a workspace
  • Validation of the DSL when configuring the flow
  • If a build could not be scheduled show the underlying cause
  • extensions can contribute to dsl help
  • aborting a flow causes all jobs scheduled and started by the flow to be aborted
  • retry is configurable
  • misc tweaks to UI and small fixes

0.10 

  • add support for SimpleParameters (parameter that can be set from a String)
  • mechanism to define DSL extensions
  • visualization moved to build-graph-view plugin
  • minor fixes

0.8 (released Feb. 11, 2013)

  • Fix folder support
  • Basic flow visualization support (thanks to ~gregory144)
  • Alternative map-style way to define parallel executions (thanks to Jeremy Voorhis)

0.7 (released Jan. 11, 2013)

  • Add support for ignore(Result)

0.6 (released November 24, 2012)

  • Enable "read job" permissions for Anonymous (issue #14027)
  • Print errors as .. errors
  • Better failed test reporting
  • Use transient ref to Job/Build …
  • Fix a NullPointer to render FlowCause after jenkins restart
  • Use futures for synchronization plus publisher support plus console println cleanup (Pull request #14 from coreyoconnor)
  • Call to Parametrized jobs correctly use their default values (Pull request #16 from dbaeli)

0.5 (released September 03, 2012)

  • fixed support for publishers (issue #14411)
  • improved job configuration UI (dedicated section, help, prepare code mirror integration)
  • improved error message

0.4 (released June 28, 2012)

  • fixed cast error parsing DSL (Collections$UnmodifiableRandomAccessList' to class 'long') on some version of Jenkins
  • add groovy bindings for current build as "build", console output as "out", environment variables Map as "env", and triggered parameters of current build as "params"
  • fixed bug when many "Parameters" links were shown for each triggered parameter on build page

0.3 (released April 12, 2012)

  • add support for hierarchical project structure (typically : cloudbees folders plugin)

0.2 (released April 9, 2012)

  • changed parallel syntax to support nested flows concurrent execution
  • fixed serialization issues

0.1 (released April 3, 2012)

  • initial release with DSL-based job orchestration

Labels

plugin-misc plugin-misc Delete
plugin-trigger plugin-trigger Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 05, 2012

    Bao Xiaopan says:

    Excellent, But where can I find the download link? And I also can not find this ...

    Excellent, But where can I find the download link? And I also can not find this plugin in "Manage Plugin" page.

  2. Apr 16, 2012

    Gregory Boissinot says:

    In my opinion, the best solution is to provide a solution on top of the XTrigger...

    In my opinion, the best solution is to provide a solution on top of the XTrigger plugin based on input/output of an environment infrastructure.
    The job to be scheduled depends on previous job outputs.

    1. Apr 03, 2012

      Nicolas De Loof says:

      Both make sense for distinct use cases. This plugin don't try to remove job depe...

      Both make sense for distinct use cases. This plugin don't try to remove job dependencies, but to make the job orchestration trivial without a bunch of plugins to configure in each job.

      1. Apr 09, 2012

        Gregory Boissinot says:

        Yes, it depends on the context. However, you don't provide tips about jobs granu...

        Yes, it depends on the context.
        However, you don't provide tips about jobs granularity.
        Unfortunately with this approach, I'm afraid you encourage users to increase dependencies between jobs. Therefore, it will lead to climb the number of issues about this subject such as synchronization points.

        In the context of a CI process with Jenkins, the process has to be implemented by only one job (in any case, in most case).
        Using XTrigger lets you delegate synchronization points with an external resource: your infrastructure environment such as a simple file or your binary repository.

        1. Apr 24, 2012

          Nicolas De Loof says:

          I know your point of view about job coupling, but I don't worry about dependenci...

          I know your point of view about job coupling, but I don't worry about dependencies between jobs, that's something I thing is useful (contributing DependencyGraph from the DSL is on my roadmap). The goal of this plugin is to remove flow configuration from jobs and to give a single place to look at it.

          XTrigger makes sense for a large set of use cases, that's not exclusive

          I don't think CI job should be implemented as a single job. Splitting in simple jobs and orchestrating them allow to parallelize and distribute the build steps on the infra for better efficiency

  3. Apr 08, 2012

    Jim Searle says:

    This sounds great! Will there be a way to specify a non-blocking job?  ...

    This sounds great!

    Will there be a way to specify a non-blocking job?  Meaning that I want to kick of a job, but not wait for it to finish, and it's build result does not matter?

    Also, a way to specify when main build can start again while other downstream jobs continue? 

    1. Apr 18, 2012

      Jim Searle says:

      I figured out a way to do both of these, but it still would be nice to have DSL ...

      I figured out a way to do both of these, but it still would be nice to have DSL syntax for it.

      1. Aug 13, 2012

        Barrett Strausser says:

        Would you mind sharing how you did this? Either with the Build Flow Plugin or wi...

        Would you mind sharing how you did this? Either with the Build Flow Plugin or without

        1. Aug 13, 2012

          Jim Searle says:

          This is my DSL: parallel (   {     build("test-buildflow-regress-1")   },   {...

          This is my DSL:

           parallel (
            {
              build("test-buildflow-regress-1")
            },
            {
              build("test-buildflow-regress-2")
              build("test-buildflow-regress-3")
            }
          )
          
          build("test-buildflow-regress-done")
          

          For the non-blocking job, I have the regress-1 use "Trigger/call builds on other projects" Build step which allows you to block or not-block and ignore build result.

          Then to allow the DSL job to start before the entire process is done, the regress-done triggers the final release jobs.

          1. Aug 15, 2012

            Barrett Strausser says:

            Thanks for the reply. I ended up figuring this out. What I am trying to figure ...

            Thanks for the reply.

            I ended up figuring this out. What I am trying to figure out now is how to nest parallel execution. I was hoping the following would work but it doesn't.

            parallel (
                { build("TryBuildFlowPackaging")
            
                        parrallel (
                                       {build("TryBuildFlowCore")},
                                       {build("TryBuildFlowPostBuild") }
                                      )
            
                },
            
               { build("TryBuildFlowDeploy") }
            
            
            )
            
  4. Apr 13, 2012

    Yi Wen says:

    This plugin doesn't seem working with git plugin? or do I do something wrong?

    This plugin doesn't seem working with git plugin? or do I do something wrong?

    1. Apr 24, 2012

      Nicolas De Loof says:

      This plugin doesn't relate to SCM. If you want to trigger a build from SCM chan...

      This plugin doesn't relate to SCM.

      If you want to trigger a build from SCM change, define a job to poll your SCM and the flow as first downstream

  5. Apr 17, 2012

    Felix Wu says:

    I got the following error with the simple DSL script build ("job"): Building on ...

    I got the following error with the simple DSL script build ("job"):
    Building on master in workspace /var/lib/jenkins/jobs/Felix/workspace
    FATAL: Cannot cast object '[hudson.model.Cause$UserIdCause@c6388a81]' with class 'java.util.Collections$UnmodifiableRandomAccessList' to class 'long'
    org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '[hudson.model.Cause$UserIdCause@c6388a81]' with class 'java.util.Collections$UnmodifiableRandomAccessList' to class 'long'

    1. Apr 19, 2012

      Roger Myung says:

      I get the same error.

      I get the same error.

    2. Apr 24, 2012

      Nicolas De Loof says:

      This issue was due to a conflict between Groovy runtime used by the plugin and t...

      This issue was due to a conflict between Groovy runtime used by the plugin and the one packaged into jenkins-core

      It has been fixed on master

  6. Apr 18, 2012

    Fabio Sobral says:

    I tried using parallel several times, adding and removing brackets and whitespac...

    I tried using parallel several times, adding and removing brackets and whitespaces, but I couldn't get it to work with more than one target.

    Whenever I had more than one build inside the parallel I would get the following output:

    Started by user XXXXX
    Building on master in workspace XXXXXXXX
    parallel {
    }
    Notifying upstream projects of job completion
    Finished: SUCCESS
    
    1. Jun 04, 2012

      Luke Murray says:

      I have the same issue. I can't get it to build jobs in parallel. Would it have ...

      I have the same issue.

      I can't get it to build jobs in parallel. Would it have anything to do with the characters in the job name?

      1. Jun 05, 2012

        Nicolas De Loof says:

        please open a Jira issue, with detailled configuration (OS, JDK, Jenkins version...

        please open a Jira issue, with detailled configuration (OS, JDK, Jenkins version etc)

        1. Jun 06, 2012

          Luke Murray says:

          Created https://issues.jenkins-ci.org/browse/JENKINS-14027 - hopefully created c...

          Created https://issues.jenkins-ci.org/browse/JENKINS-14027 - hopefully created correctly. If you need anymore information let me know.

  7. Apr 18, 2012

    Jim Searle says:

    I have this DSL: parallel (   {     build("test-buildflow-regress-1")   }, ...

    I have this DSL:

    parallel (
      {
        build("test-buildflow-regress-1")
      },
      {
        build("test-buildflow-regress-2")
        build("test-buildflow-regress-3")
      }
    )
    
    parallel (
      { build("test-buildflow-release-1") },
      { build("test-buildflow-release-2") }
    )
    

    I purposely made test-buildflow-regress-3 fail, but it still ran release-1 and release-2.  Is that expected?  I thought it would stop on a failure.  This log shows it still kicks off the 2 release jobs?

    Started by user XXXX
    Building on master in workspace XXXX
    parallel {
    Trigger job test-buildflow-regress-1
    Trigger job test-buildflow-regress-2
    
    Completed test-buildflow-regress-2 #4
    Trigger job test-buildflow-regress-3
    
    Completed test-buildflow-regress-1 #4
    
    Completed test-buildflow-regress-3 #3
    }
    parallel {
    Trigger job test-buildflow-release-1
    Trigger job test-buildflow-release-2
    
    Completed test-buildflow-release-2 #1
    Completed test-buildflow-release-1 #1
    }
    Notifying upstream projects of job completion
    Finished: FAILURE
    
    1. Apr 24, 2012

      Nicolas De Loof says:

      This is clearly unexpected. I've added a test to check this scenario, and test ...

      This is clearly unexpected.

      I've added a test to check this scenario, and test pass :-/

      Please open a Jira and report jenkins version you use for further investigations

      1. Nov 22, 2012

        Damien Coraboeuf says:

        Using version 0.5, I still get this problem. Using the following flow: guard {...

        Using version 0.5, I still get this problem. Using the following flow:

        guard {
           build ("test-a")
           parallel (
              { build("test-b") },
              { build("test-c") }
           )
           parallel (
              { build("test-d") },
              { build("test-e") }
           )
        } rescue {
           build ("test-f")
        }
        

        Whenever "test-b" job fails (for example), "test-d" and "test-e" will be executed still. Is there something wrong with the syntax?

        I have created the JENKINS-15900 issue to follow this problem.

        Regards,
        Damien.

        1. Nov 22, 2012

          Nicolas De Loof says:

          syntax is ok, I just have no idea why this don't behave as expected and can't re...

          syntax is ok, I just have no idea why this don't behave as expected and can't reproduce

  8. Apr 18, 2012

    Jim Searle says:

    It would be nice if there was an option to read the DSL from a file, like the en...

    It would be nice if there was an option to read the DSL from a file, like the envinject plugin allows.

  9. Apr 30, 2012

    Vlad Melnyk says:

    How can I run job with current build parameters? build("job", foo: $foo) does n...

    How can I run job with current build parameters?

    build("job", foo: $foo) does not work

    1. May 01, 2012

      Nicolas De Loof says:

      This is not implemented yet, will probably expose a "params" variable as a Map. ...

      This is not implemented yet, will probably expose a "params" variable as a Map. Woudl you like to contribute this ? ;)

      1. Jun 08, 2012

        Greg Temchenko says:

        I would like to ;) https://github.com/jenkinsci/build-flow-plugin/pull/3
        1. Jun 29, 2012

          Dimitri BAELI says:

          Can you add a sample in the doc ? it's not clear on how to use that (If I correc...

          Can you add a sample in the doc ? it's not clear on how to use that (If I correctly guess that it's included in 0.4).

          Thanks

        2. Jul 02, 2012

          Dimitri BAELI says:

          The usage for params is  build("paramJob1", PARAM_1:params["BUILD_PARAM"])...

          The usage for params is 

          build("paramJob1", PARAM_1:params["BUILD_PARAM"])
          
  10. May 16, 2012

    Xiao Du says:

    I tried to run a job with several parameters. build("PMD", "root.cvs":"cvsro...

    I tried to run a job with several parameters.

    build("PMD", "root.cvs":"cvsroot", "package.cvs":"WEB/APP")

    However, it seems that the plugin only recognizes the first parameter.

    $ cmd.exe /C '"ant.bat -Droot.cvs=cvsroot tools.pmd.continuousIntegration ....
    1. Jun 28, 2012

      Nicolas De Loof says:

      This case is tested on https://github.com/jenkinsci/build-flow-plugin/blob/...

      This case is tested on https://github.com/jenkinsci/build-flow-plugin/blob/master/src/test/groovy/com/cloudbees/plugins/flow/BuildTest.groovy#L42 and is ok

      please provide such a test to demonstrate the issue

  11. May 28, 2012

    rohan shetty says:

    Hello Everyone, Is there a faclility to comment within the DSL block so that at...

    Hello Everyone,

    Is there a faclility to comment within the DSL block so that at times one of the job can be commented ???

    for instance :  I have 3 jobs in the sequence of BuildFlow as follows :
    build("jobA")
    build("jobB")
    build("jobC")

    among the above 3 jobs, if i just want to run jobA and jobC ,
    so currently i have to delete the entry of  jobB and then again add it when needed.

    It will be good to have an option like below :
    build("jobA")
    // build("jobB")
    build("jobC")

    Here after jobA directly jobC will run !!!

    Hoping for a reply, suggestions always welcome !!!

  12. Jun 28, 2012

    Andreyev Melo says:

    Issue Tracking links to wrong component ('build-flow-plugin') or it was changed....

    Issue Tracking links to wrong component ('build-flow-plugin') or it was changed. Correct name is just 'build-flow'.

    1. Jun 28, 2012

      Nicolas De Loof says:

      don't know how to change this on Jira :'(

      don't know how to change this on Jira :'(

      1. Jun 28, 2012

        Andreyev Melo says:

        I guess that this block is automatically embedded here by Confluence... BTW, I s...

        I guess that this block is automatically embedded here by Confluence... BTW, I see others plugin with same problem, so I guess that components name was bulk changed on JIRA...

        Maybe KK could fix this, but I guess he have more priority things to do, so, what about put a tip on page's top, like that:

        {tip:title=issues}
        [Here is our issues|https://issues.jenkins-ci.org/secure/IssueNavigator.jspa?mode=hide&reset=true&jqlQuery=project+%3D+JENKINS+AND+status+in+%28Open%2C+%22In+Progress%22%2C+Reopened%29+AND+component+%3D+'build-flow']
        {tip}
        
  13. Jul 02, 2012

    Dimitri BAELI says:

    Why version 0.4 is tagged in git but not available for download in jenkins (even...

    Why version 0.4 is tagged in git but not available for download in jenkins (even 1.473) ?

    Is it a mistake or the version is being verified somehow ?

    Thank you, this plugin looks really great.

  14. Jul 13, 2012

    Shankar krishnan says:

    Is it possible to use this plugin in Hudson version 2.2.1 I need a similar flo...

    Is it possible to use this plugin in Hudson version 2.2.1

    I need a similar flow control and we are using hudson as a build tool.

    1. Jul 13, 2012

      Nicolas De Loof says:

      don't know, and honesty don't care. Give it a try

      don't know, and honesty don't care. Give it a try

  15. Aug 05, 2012

    Leslie Chong says:

    Thanks for this plugin. It's great. I'm wondering if there'll ever be support fo...

    Thanks for this plugin. It's great. I'm wondering if there'll ever be support for a more dynamic setup. Specifically, I'd like to spawn off a dynamic number of parallel builds with dynamic parameters. Something like:

    parallel(

    for each item in items

    build ("job", param: "item")

    )

    We can do some these things using the Jenkins API but I would like to find a way to manage this within Jenkins with less code.

    Thanks!

    1. Jan 28, 2013

      Chang-Yul Choi says:

      I very hardly got an answer from source code. Try below script. It works!&#...

      I very hardly got an answer from source code.

      Try below script. It works!!

       // allows syntax like : parallel(["Kohsuke","Nicolas"].collect { name -> return { build("job1", param1:name) } })
  16. Aug 13, 2012

    Barrett Strausser says:

    How may I access parameters passed to a build in another build ? I've tried pull...

    How may I access parameters passed to a build in another build ? I've tried pulling it out from the Abstract Build but that doesn't seem to work.

    For instance I want to do :

    core = build("TryBuildFlowCore", PRIMARYWORKSPACE: "foobar")
    core.properties.each { out.println "$it.key -> $it.value" }
    
    out.println 'Triggered Parameters Map:'
    out.println params
    out.println 'Build Object Properties:'
    build.properties.each { out.println "$it.key -> $it.value" }
    
    parallel (
        {
            build("TryBuildFlowPackaging",Var:core.build.PRIMARYWORKSPACE)
            build("TryBuildFlowDeploy")
        },
        {
            build("TryBuildFlowPostBuild")
    
        }
    )

    This will lead to a Null Reference exception.

    Edited to put code in code block.

  17. Aug 16, 2012

    Graham Kelly says:

    Hi, apologies for asking this on the plugin page (I know you requested not to). ...

    Hi, apologies for asking this on the plugin page (I know you requested not to). I can't join the jenkins-users list at the moment (Can't access from work!)

    Is there any way to trigger a manual step in build-flow? For example, perform a  build, trigger a deployment, run integration tests against the deployed app, with the deployment needing to wait on manual approval.

    For example:

    Example build flow
    parallel {
       build("build-job1")
       build("build-job2")
    }
    
    manual {
       build("deploy-all", deploy-ip: "127.0.0.1")
    }
    //Or manual("deploy-all", deploy-ip: "127.0.0.1")???
    
    build("run-integration-tests", it-env-ip: "127.0.0.1")

    I have also asked this on StackOverflow.

    Thanks

  18. Aug 23, 2012

    Martin Malek says:

    Is it possible to pass git commit hash to next step? My flow is "Run unit tests"...

    Is it possible to pass git commit hash to next step? My flow is "Run unit tests" > "Deploy" > "Run smoke tests". I need to deploy the correct commit. What can happen is that I'll push two commits really fast and before the unit tests finish, so the "Deploy" job will try to deploy last commit and not the commit which was tested.

    1. Jun 13, 2013

      Skuli Arnlaugsson says:

      You could do something like: Pass GIT_COMMIT sha to other jobs git_commit = b...

      You could do something like:

      Pass GIT_COMMIT sha to other jobs
      git_commit = build.properties["environment"]["GIT_COMMIT"]
      
      build( "unit-tests", GIT_COMMIT: git_commit )
      build( "deploy", GIT_COMMIT: git_commit )
      build( "smoke-tests", GIT_COMMIT: git_commit )
      

      Then use the Git plugin and have the pipeline job connected to git, then GIT_COMMIT will be in the pipeline env. Then in the other jobs use GIT_COMMIT instead of the head of the branch.

  19. Sep 13, 2012

    ritesh Kumar says:

    Suppose i am running four parallel jobs and one job fails while others are still...

    Suppose i am running four parallel jobs and one job fails while others are still running. is there any way where Jenkins can stop all other running jobs if one job fails.

    1. Sep 13, 2012

      Nicolas De Loof says:

      this is technically possible as jenkins offer a job cancellation feature. Could ...

      this is technically possible as jenkins offer a job cancellation feature. Could maybe be an option for parallel() keyword

  20. Sep 13, 2012

    Andreyev Melo says:

    You can use an environment variable from one build into another with: b = buil...

    You can use an environment variable from one build into another with:

    b = build( "test-bf" )
    
    //use b.build.properties.environment to get all variables
    
    a=b.build.properties.environment["SVN_URL"]
    
    out.println a
    

    I guess that this should be helpful, but don't know where put it....

  21. Sep 26, 2012

    Francisco José Guerrero Sánchez says:

    I needed use a SCM polling to trigger a Build Flow; you can type a Cron expressi...

    I needed use a SCM polling to trigger a Build Flow; you can type a Cron expression but currently you can´t select your SCM source, and its parameters .

    so I've added the next tag to the file $JENKINS_HOME/plugins/build-flow-plugin/WEB-INF/classes/com/cloudbees/plugins/flow/BuildFlow/configure-entries.jelly  

    <p:config-scm/>

    and It works fine !! you can launch a new build trough the SCM trigger

    I think this could be a great idea to include it in the new version.

    1. Oct 03, 2012

      Nicolas De Loof says:

      For this use case you should better have a job to get triggered by SCM and decla...

      For this use case you should better have a job to get triggered by SCM and declare the flow as downstream job.

      having a flow to declare scm don't make much sense as it don't access this scm to orchestrate the execution.

  22. Oct 01, 2012

    Alex Vesely says:

    Awesome plugin. A very nice enhancement would be the ability to block the build...

    Awesome plugin.

    A very nice enhancement would be the ability to block the build if some job is running, kind of like this plugin does: [https://wiki.jenkins-ci.org/display/JENKINS/Build+Blocker+Plugin|../../../../../../../../../display/JENKINS/Build+Blocker+Plugin]

  23. Oct 03, 2012

    Chris Kramer says:

    Upgrade van 0.4 to 0.5 causes all flow jobs to dissapear.. Why and how to preven...

    Upgrade van 0.4 to 0.5 causes all flow jobs to dissapear.. Why and how to prevent this?

    We have like 20 flows and it would be really bad if we had to recreate them all...

    1. Oct 03, 2012

      Nicolas De Loof says:

      Due to inheritance change, jenkins can't load the job due to collection not bein...

      Due to inheritance change, jenkins can't load the job due to collection not being initialized in parent class during deserialization

      You can fix this by adding to your job config.xml :

      <builders/> 
      <publishers/> 
      <buildWrappers/>

      Please don't use this wiki as a bug tracker, either open ticket on issues.jenkins-ci.org, or (better) subscribe to user list and ask there

      1. Oct 10, 2012

        Chris Kramer says:

        Fair enough, sorry for reporting the bug this way. I'll subscribe to the user l...

        Fair enough, sorry for reporting the bug this way.

        I'll subscribe to the user list as well :-)

        Thanks for replying though! I'll pick up the manual actions ASAP. 

  24. Oct 23, 2012

    Greg horvath says:

    I've opened a ticket in JIRA about Publishers not running after the flow jobs co...

    I've opened a ticket in JIRA about Publishers not running after the flow jobs complete.  There was a previous ticket which addressed a similar issue -- namely, publishers not being saved from the configure page.  Well, they are being saved now -- but never run.  

    I've been digging for a bit and -- if I understand how the Publishers are invoked -- I believe that things should work with the current version of the plugin, but they aren't.  Any insight here would be useful.

     If we figure it out, we'll submit a pull request.  However, someone more familiar with this could probably fix it much quicker.

    1. Oct 23, 2012

      Greg horvath says:

      And to follow up on this -- I can't see from the ticket history or the c...

      And to follow up on this -- I can't see from the ticket history or the code that the plugin ever successfully supported publishers.  I'd think this is a pretty major oversight, as there aren't many viable workarounds.

  25. Nov 20, 2012

    Damien Coraboeuf says:

    Hi, any indication about the roadmap and the future releases? Thanks, Damien.

    Hi, any indication about the roadmap and the future releases?

    Thanks,

    Damien.

    1. Dec 01, 2012

      Dimitri BAELI says:

      We just released one version, what would you like to have next ?

      We just released one version, what would you like to have next ?

      1. Dec 01, 2012

        Nicolas De Loof says:

        Roadmap is mostly about volunteers to contribute.  My personal focus will ...

        Roadmap is mostly about volunteers to contribute. 

        My personal focus will be on making the DSL safe (using groovy-sandbox) and make visualization work

  26. Feb 07, 2013

    Venkat Prasad says:

    Ignore does not work. Can you please help me? ignore(FAILURE) { build( "...

    Ignore does not work. Can you please help me?

    ignore(FAILURE) {
        build( "send_twitter_notification" )
    }
    

    error

    ERROR: Failed to run DSL Script
    groovy.lang.MissingMethodException: No signature of method: com.cloudbees.plugins.flow.FlowDelegate.ignore() is \
    applicable for argument types: (java.lang.String, Script1$_run_closure1_closure4) values: [FAILURE, Script1$_run_closure1_closure4@3a549607]
    Possible solutions: grep()
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    
  27. Mar 13, 2013

    Martin Rauh says:

    Hi, is there any way to use a for loop in a parallel( ... ) statement? We want...

    Hi,

    is there any way to use a for loop in a parallel( ... ) statement?

    We want to start many instances of a job with a counter parameter to run in parallel.

    Thanks,

    Martin

    1. May 27, 2013

      Nicolas De Loof says:

      use a loop to create a closure list or map, and pass it to parallel()

      use a loop to create a closure list or map, and pass it to parallel()

  28. Jun 07, 2013

    Franck Derunes says:

    Hi, It seems the ignore(FAILURE) when using a variable. here is my code: I use...

    Hi,

    It seems the ignore(FAILURE) when using a variable. here is my code:

    I use a text parameter called tests

    def tests= params["tests"].split();
    tests.each()
    {
    ignore(FAILURE) {
    build("${it}");
    }
    }
    

    if i remove the ignore(FAILURE) {} part, the script works, but unfortunately the test suite stops at the first failure and the others tests won't be executed. 

    Could you please help me figure this out?

  29. Jun 11, 2013

    hyunil shin says:

    (Windows) I downloaded the source code, import it as Eclipse project. An...

    (Windows) I downloaded the source code,

    import it as Eclipse project.

    And run hpi:run, open web browser http://localhost:8080/.

    But the job configruation page is displayed like this (I cannot attach screenshot due to secruity)

    and when to run build,  nothing is executed.

    build trigger

    ---------------------------

    - xxxx

    - Build periodically

    - Poll SCM

     Define build flow using flow DSL (textarea)

    Post-build action

    ----------------------------------

    Add post-build action

    As compared to normal situation there is no Flow Definition section.

  30. Nov 12

    Jay Spang says:

    I'm still seeing this issue, even though it was supposed to be fixed back in Mar...

    I'm still seeing this issue, even though it was supposed to be fixed back in March - https://issues.jenkins-ci.org/browse/JENKINS-18003 - All build flow graphs disappear after a few hours (whether Jenkins restarts or not). Does anyone know if this is a known issue or an incompatibility with other plugins? I can't seem to find much evidence of anyone else having the same problems anymore.

    • Jenkins 1.537 (Windows 2012)
    • Build Flow 0.10
  31. Nov 26

    Saran Niyakit says:

    Hi, I found some issues for build flow plug-in. For lasted version 0.10 whic...

    Hi,

    I found some issues for build flow plug-in.

    1. For lasted version 0.10 which has dependency “buildgraph-view” plug-in I install buildgraph-view then trigged run jobs. Jobs run fine except graph did not show.
    2. I downgrade to previous version 0.8 everything work fine including graph when jobs is running.

              When I come back to previous jobs that finished the graph disappeared.  In the case I’m not sure about how long build flow plug-in keeps the graph.

    Any help would be appreciated.

    1. Nov 26

      Nicolas De Loof says:

      This wiki is not an issue tracker, please use jira and join jenkins-user mailing...

      This wiki is not an issue tracker, please use jira and join jenkins-user mailing list

  32. Jan 27

    Alexander Uvizhev says:

    Is there a way to specify where particular build should run? By providing a labe...

    Is there a way to specify where particular build should run? By providing a label or a node name.

  33. Feb 26

    Thomas Wyremblewsky says:

    Hi, I have a few questions and a big problem. First my questions: 1 Is it pos...

    Hi,

    I have a few questions and a big problem.

    First my questions:

    1 Is it possible to start a sub flow in the main flow like this

    main flow dsl named main_flow:build ('sub_flow')

    2 Can I start another job after completing the flow using a post build action like 'trigger parametrized build on other plugins'?

    And after all the problem.

    dsl

    parallel(
    
    {retry ( 2 ){  build ("Job_Deploy_Batch_ReferenzBatch_Flow_Snap")  }
    
    },
    
    {retry ( 2 ){  build ("Job_Deploy_Batch_Referenz_Flow_Snap")  }
    
    },
    
    {retry ( 2 ){  build ("Job_Deploy_EJB_Referenz_Flow_Snap")  }
    
    },
    
    {retry ( 2 ){  build ("Job_Deploy_Service_GenesisWlM_Flow_Snap")  }
    
    },
    
    {retry ( 2 ){  build ("Job_Deploy_Service_Referenz_Flow_Snap")  }
    
    },
    
    {retry ( 2 ){  build ("Job_Deploy_Web_GenesisBatchAdmin_Flow_Snap")  }
    
    }
    
    )

    Everything is all right, but at the end the job failed.

    parallel {
    retry (attempt 1) {
    retry (attempt 1) {
    Schedule job Job_Deploy_Batch_ReferenzBatch_Flow_Snap
    retry (attempt 1) {
    Schedule job Job_Deploy_Batch_Referenz_Flow_Snap
    retry (attempt 1) {
    Schedule job Job_Deploy_Service_GenesisWlM_Flow_Snap
    retry (attempt 1) {
    Schedule job Job_Deploy_Web_GenesisBatchAdmin_Flow_Snap
    Schedule job Job_Deploy_EJB_Referenz_Flow_Snap
    retry (attempt 1){                             Build Job_Deploy_Batch_Referenz_Flow_Snap #8 started                             Build Job_Deploy_Batch_ReferenzBatch_Flow_Snap #8 started                             Build Job_Deploy_Service_GenesisWlM_Flow_Snap #8 started                             Build Job_Deploy_Web_GenesisBatchAdmin_Flow_Snap #8 started                             Build Job_Deploy_EJB_Referenz_Flow_Snap #8 started                             Job_Deploy_Batch_ReferenzBatch_Flow_Snap #8 completed                         }
    Job_Deploy_EJB_Referenz_Flow_Snap #8 completed
    }
    Job_Deploy_Web_GenesisBatchAdmin_Flow_Snap #8 completed
    }
    Job_Deploy_Service_GenesisWlM_Flow_Snap #8 completed
    }
    Job_Deploy_Batch_Referenz_Flow_Snap #8 completed
    }
    }
    Notifying upstream projects of job completion
    Finished: FAILURE

    Normally this steps should follow.

    build ("Server_Restart_Portal_HEAD")
    
    out.println 'Deploy skins and themes'
    
    retry ( 2 ){ 					skins_deploy = build ("Job_Deploy_SkinsAndThemes61_Flow_Snap") 				}
    out.println skins_deploy

    I have no idea why and how this happens.

    Any suggestions?

    I use jenkins 1.532.1 and build flow plugin 1.480.

    Thx Tommy

    1. Feb 26

      Nicolas De Loof says:

      if you have questions, JOIN THE USER-LIST this wiki isn't a forum

      if you have questions, JOIN THE USER-LIST

      this wiki isn't a forum

      1. Feb 27

        Thomas Wyremblewsky says:

        Joined. Oh, not joined. Subscribing doesn't work. Mail routing error jenkinsci...

        Joined.

        Oh, not joined. Subscribing doesn't work. Mail routing error

        jenkinsci-users_subscribe@googlegroups.com
        550-5.1.1 The email account that you tried to reach does not exist. Please try
        What about the problem? Do you have any ideas, suggestions relating to my problem?

  34. Mar 02

    Gil Shinar says:

    Hi, This plugin is just great. Thanks a lot. Is there a way to use conditional...

    Hi,

    This plugin is just great. Thanks a lot.

    Is there a way to use conditionals in the DSL? I want to use a Boolean parameter that'll indicate whether a certain job should or shouldn't run.

    Thanks

    Gil 

    1. Mar 02

      Gil Shinar says:

      How do I join the users list? Thabks Gil

      How do I join the users list?

      Thabks

      Gil

  35. Apr 16

    Sergey Smirnov says:

    "build flow no longer has a workspace" But I need workspace. I want to create f...

    "build flow no longer has a workspace"

    But I need workspace. I want to create file on workspace to pass results to upstream job.

    Please return workspace back.