Skip to content
This repository was 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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6b7c833 · Mar 18, 2018

History

62 Commits
Oct 12, 2016
Mar 18, 2018
Jul 26, 2015
Jul 26, 2015
Mar 18, 2018
Mar 18, 2018
Jul 3, 2016
Jul 25, 2015
Jun 22, 2016
Dec 19, 2015
Mar 18, 2018

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