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

provides a way to access build artifacts generated by a step in LambdaCD

License

Notifications You must be signed in to change notification settings

flosell/lambdacd-artifacts

Repository files navigation

lambdacd-artifacts

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.

Status

Build Status

Clojars Project

Usage

; 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. The latest available artifact is served under /latest/$step-id/... as well.

For a full example, see test/lambdacd_artifacts/sample_pipeline.clj

Development

Call ./go

License

Copyright © 2015 Florian Sellmayr

Distributed under the Apache License 2.0