Control-flow elements for a pipeline: steps that control the way their child-steps are being run.
Control-flow elements for a pipeline: steps that control the way their child-steps are being run.
(alias alias child)
Just runs child but child is displayed with the given alias in visualization.
Example:
(def pipeline-structure
`(; ...
(alias "tests"
(run
unit-test
acceptance-test)))
Just runs child but child is displayed with the given alias in visualization. Example: ```clojure (def pipeline-structure `(; ... (alias "tests" (run unit-test acceptance-test))) ```
(either & steps)
Build step that executes its children in parallel and returns after the first child finished successfully. Commonly used to wait for one of multiple triggers to return.
Example:
(def pipeline-structure
`((either
wait-for-git-commit
wait-for-manual-trigger)
build
test
deploy))
Build step that executes its children in parallel and returns after the first child finished successfully. Commonly used to wait for one of multiple triggers to return. Example: ```clojure (def pipeline-structure `((either wait-for-git-commit wait-for-manual-trigger) build test deploy)) ```
(in-cwd cwd & steps)
Build step that executes its children in sequence and passes the value of a given working directory to each of them. Returns once the last step finished.
Example:
(defn some-step [args ctx]
(println "The working directory:" (:cwd args)))
(def pipeline-structure
`(; ...
(in-cwd "/tmp/some-dir"
some-step
some-other-step)))
Build step that executes its children in sequence and passes the value of a given working directory to each of them. Returns once the last step finished. Example: ```clojure (defn some-step [args ctx] (println "The working directory:" (:cwd args))) (def pipeline-structure `(; ... (in-cwd "/tmp/some-dir" some-step some-other-step))) ```
(in-parallel & steps)
Build step that executes its children in parallel and returns after all children finished successfully. Commonly used to parallelize build independent build steps
Example:
(def pipeline-structure
`(; ...
build
(in-parallel
test-backend
test-frontend)
deploy))
Build step that executes its children in parallel and returns after all children finished successfully. Commonly used to parallelize build independent build steps Example: ```clojure (def pipeline-structure `(; ... build (in-parallel test-backend test-frontend) deploy)) ```
(junction condition-step success-step failure-step)
Build step that executes the first child and, depending on its success, the second or third child. Commonly used for conditional, if-then-else logic in pipelines.
Example:
(def pipeline-structure
`(; ...
(junction
should-do-something?
step-to-run-if-success
step-to-run-if-not-success)))
Build step that executes the first child and, depending on its success, the second or third child. Commonly used for conditional, if-then-else logic in pipelines. Example: ```clojure (def pipeline-structure `(; ... (junction should-do-something? step-to-run-if-success step-to-run-if-not-success))) ```
(run & steps)
Build step that executes its children in sequence and returns once the last step finished.
Commonly used to pass a chain of steps to into a control flow expecting only one (e.g. either
, junction
) or
to wrap related steps into a container and alias
it to structure the pipeline.
Example:
(def pipeline-structure
`(; ...
(alias "tests"
(run
unit-test
acceptance-test))
(junction
should-deploy?
(run
deploy-ci
deploy-qa)
do-nothing)))
Build step that executes its children in sequence and returns once the last step finished. Commonly used to pass a chain of steps to into a control flow expecting only one (e.g. `either`, `junction`) or to wrap related steps into a container and `alias` it to structure the pipeline. Example: ```clojure (def pipeline-structure `(; ... (alias "tests" (run unit-test acceptance-test)) (junction should-deploy? (run deploy-ci deploy-qa) do-nothing))) ```
(with-workspace & steps)
Runs given steps with a clean workspace given to child step as :cwd argument.
Commonly used if a build step needs some temporary directory to run, e.g. clone repositories and run build tasks.
The given workspace is not persistent, it only exists for the runtime of the build step and is deleted afterwards.
Long-living artifacts should be stored in an external artifact repository or using additional libraries like lambdacd-artifacts
.
Example:
(defn some-step [args ctx]
(println "The working directory:" (:cwd args)))
(def pipeline-structure
`(; ...
(with-workspace
some-step
some-other-step)))
Runs given steps with a clean workspace given to child step as :cwd argument. Commonly used if a build step needs some temporary directory to run, e.g. clone repositories and run build tasks. The given workspace is not persistent, it only exists for the runtime of the build step and is deleted afterwards. Long-living artifacts should be stored in an external artifact repository or using additional libraries like [`lambdacd-artifacts`](https://github.com/flosell/lambdacd-artifacts). Example: ```clojure (defn some-step [args ctx] (println "The working directory:" (:cwd args))) (def pipeline-structure `(; ... (with-workspace some-step some-other-step))) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close