Provides a way to access build artifacts generated by a step in LambdaCD, similar "archive artifacts" in Jenkins. Use this if you want access build artifacts like test-reports or screenshots from failed selenium tests from your browser.
; some step that produces artifacts
(defn- produce-output [args ctx]
(shell/bash ctx (:cwd args) "./produceSomeFiles.sh"))
; the build-step you put in your pipeline: first build artifacts, then publish them
(defn some-build-step [args ctx]
(step-support/chaining args ctx ; use always-chaining if you want the artifact even if previous steps failed (e.g. for test reports)
(produce-output injected-args injected-ctx)
(artifacts/publish-artifacts injected-args injected-ctx
(:cwd injected-args) [#"report-folder/.*"
"some-folder/someBinary.jar"])))
; url prefix where your artifacts will be available
(def artifacts-path-context "/artifacts")
(defn -main [& args]
(let [; ...
config {:home-dir home-dir ; this is where artifacts are stored
:artifacts-path-context artifacts-path-context}
pipeline (lambdacd/assemble-pipeline pipeline-structure config)]
; ...
; set up routes to your pipeline and to your artifacts
(ring-server/serve (routes
(context "/pipeline" [] (ui/ui-for pipeline))
(context artifacts-path-context [] (artifacts/artifact-handler-for pipeline)))))
Paths to the artifacts will be stored under the :details
key in the step result and displayed in the UI.
For a full example, see test/lambdacd_artifacts/sample_pipeline.clj
Call ./go
Copyright © 2015 Florian Sellmayr
Distributed under the Apache License 2.0