This repository was archived by the owner on Jun 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
Step Support
Florian Sellmayr edited this page Mar 6, 2016
·
5 revisions
Import: (:require [lambdacd.steps.support :as support])
Contains support functionality to compose more complex build steps
Macro that wraps the given body with *out* redirected to the output of the build step instead of stdout.
Useful if you need your build steps to output text.
(defn some-build-step [args ctx]
(capture-output ctx (println "Hello")
(println "World")
{:status :success}))
; Step Result: => {:out "Hello\nWorld\n" :status :success }Executes a number of build steps sequentially. Behaves as if those steps were part of a pipeline, i.e. data can be passed from one step to the other, stops after the first failure, ...
Useful if you want to combine several of your build steps into one more coarse-grained build step.
(defn some-step [args ctx]
(chain-steps args ctx some-other-step
some-third-step))Macro around chain-steps that allows defining chained steps inline.
(note bug #93 (fixed in versions >0.7.0))
(:require [lambdacd.steps.support :as support :refer [chaining injected-args injected-ctx])
(defn some-step [args ctx]
(chaining args ctx (some-other-step injected-args injected-ctx)
(some-third-step injected-args injected-ctx)
(some-step-that-doesnt-need-parameters)
(some-step-with-parameters "param1" (:param2 injected-args) 42)))
; ---
(defn some-step-where-we-debug [args ctx]
(capture-output ctx
(chaining args ctx
(some-step injected-args injected-ctx)
(print "foo-value:" (:foo injected-args)) ;
(some-other-step injected-args injected-ctx))))