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

Configuration

Florian Sellmayr edited this page Apr 3, 2016 · 10 revisions

LambdaCD is configurable through the config hash given to the assemble-pipeline function:

(let [config {:home-dir home-dir
              :name "some pipeline"
              :shutdown-sequence lambdacd.core/default-shutdown-sequence
              :ms-to-wait-for-shutdown (* 10 1000)
              :ui-config {:expand-active-default true
                          :expand-failures-default true}}
      pipeline (core/assemble-pipeline pipeline-def config)]
  ; ...
)

This hash is used by a variety of components inside of LambdaCD. These options are currently available:

  • :home-dir: Configures the directory used by LambdaCD to store internal data (e.g. build history, workspaces, ...)
  • :name (optional): If set, this name is displayed in the UI
  • :shutdown-sequence (optional): A function taking one argument (ctx) that is called when shutting down LambdaCD. Defaults to default-shutdown-sequence which stops the pipeline runner, kills active pipelines and finalizes persistence
  • :ms-to-wait-for-shutdown (optional): Max time in milliseconds to wait for build steps to be killed before continuing shutdown (since version 0.8.0). Defaults to 10 seconds.
  • :ui-config (optional): Configuration for the UI (since version 0.8.0)
    • :expand-active-default: Configures if active steps should be expanded by default
    • :expand-failures-default: Configures if failed steps should be expanded by default

The hash is also available to build steps through the ctx-value to add custom configuration for build steps:

(let [config {:home-dir home-dir
              :some-feature-active true}
      pipeline (core/assemble-pipeline pipeline-def config)]
  ; ...
)

; ... 

(defn some-step [args ctx]
  (if (:some-feature-active (:config ctx))
    (do-something-with-feature)
    (do-something-without-feature)))
Clone this wiki locally