Skip to content

Pipeline Structure DSL

Florian Sellmayr edited this page Sep 16, 2015 · 2 revisions

Structure

The structure of a pipeline in LambdaCD is defined as a syntax-quoted list of functions.

(def pipeline
  `(
    (either
      wait-for-manual-trigger
      wait-for-repo)
    (with-repo
      run-tests
      compile-and-deploy)))

Those functions are the Build Steps. You can either directly put in functions that fulfill the build-step contract or calls to a function that returns a function that fulfills the same contract. Those functions will be evaluated when starting the pipeline.

Parameterization

Pipeline Structures don't have to be static. They can be generated on the fly, using all the usual methods for dealing with (syntax-quoted) lists. They can be concatenated, filtered, mapped. Specifically, the unquote-operator ~ can be used to include dynamic values:

(defn mk-pipeline-def [repo-uri test-command]
  `(
     wait-for-manual-trigger
     (with-repo ~repo-uri
                (run-tests ~test-command)
                publish)))

See also Howto