Skip to content
Florian Sellmayr edited this page Feb 5, 2017 · 6 revisions

Overview

introduced in version 0.13.0

Build Steps can retrieve and change build metadata by accessing the atom :build-metadata-atom in ctx. Changes to this atom are automatically persisted and available throughout the build. This can be used to manage state that should be shown to the user in the UI or to manage state for higher level APIs.

Example

(defn build-step-setting-build-label [args ctx]
  (support/assoc-build-metadata! ctx :human-readable-build-label "some-build-label")
  {:status :success})

(defn build-step-setting-build-label-without-helper-functions [args ctx]
  (swap! (:build-metadata-atom ctx) #(assoc % :human-readable-build-label "some-build-label"))
  {:status :success})

Reserved Values

Build Metadata is a map of mostly arbitrary values. However, some have special meaning for LambdaCD or a supporting library:

  • :human-readable-build-label can be displayed instead of the build-number in the UI

Supporting functions

  • lambdacd.steps.support/assoc-metadata! is a shorthand that simplifies an assoc on the build-metadata