Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Control Flow

Florian Sellmayr edited this page Sep 19, 2015 · 6 revisions

Import: (:require [lambdacd.steps.control-flow :refer :all])

All control flow steps are functions that take a set of child steps and return a build-step that executes those children in a particular manner.

in-parallel

Executes child-steps in parallel and waits for all of them to finish successfully. Returns success if all children return success.

Example:

(def pipeline-structure
  `(;...
    (in-parallel
      do-something
      do-something-else)))

run

Executes child-steps sequentially, just like they would in a normal pipeline. Can be used to group steps logically or to create sub-pipelines where normally only a single step would be expected.

Example:

(def pipeline-structure
  `(;...
    (in-parallel
      (run do-something afterwards-do-something-else)
      (run do-something2 afterwards-do-something-else2))))

either

Executes all child-steps in parallel and returns after one of the childs was successful Then kills all remaining children. Returns success if at least one child was successful. Often used to have multiple triggers for a pipeline.

Example:

(def pipeline-structure
  `(;...
    (either
      wait-for-git-commit
      wait-for-manual-trigger)))

junction

Receives three children: A condition step and two steps, one of which will be executed depending on the result of condition step. Returns the success of the called branch.

Example:

(def pipeline-structure
  `(;...
    (junction
      some-condition
      step-on-success-of-condition
      step-on-failure-of-condition)))
Clone this wiki locally