<commit_before># lambdacd-artifacts

Provides a way to access build artifacts generated by a step in [LambdaCD](https://github.com/flosell/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](https://travis-ci.org/flosell/lambdacd-artifacts.svg)](https://travis-ci.org/flosell/lambdacd-artifacts)

[![Clojars Project](http://clojars.org/lambdacd-artifacts/latest-version.svg)](http://clojars.org/lambdacd-artifacts)

## Usage

```clojure
; 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/chain args ctx
    (produce-output)
    (artifacts/publish-artifacts (:cwd 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)))))
```

You'll find the paths to the published artifacts in the detailed step-result. The next version of LambdaCD will provide
a proper UI to display those links (see [flosell/lambdacd#37](https://github.com/flosell/lambdacd/issues/37)).<commit_msg>Remove reference to pending issue in LambdaCD, this has long been released<commit_after># lambdacd-artifacts

Provides a way to access build artifacts generated by a step in [LambdaCD](https://github.com/flosell/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](https://travis-ci.org/flosell/lambdacd-artifacts.svg)](https://travis-ci.org/flosell/lambdacd-artifacts)

[![Clojars Project](http://clojars.org/lambdacd-artifacts/latest-version.svg)](http://clojars.org/lambdacd-artifacts)

## Usage

```clojure
; 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/chain args ctx
    (produce-output)
    (artifacts/publish-artifacts (:cwd 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. 
{'fraction_non_alphanumeric': 0.11794734013970984, 'fraction_numerical': 0.0010746910263299302, 'mean_word_length': 3.2646048109965635, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '35611', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1093, 'n_words': 330}