Skip to content

Commit

Permalink
refactored
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoKramer committed Feb 26, 2020
1 parent e939327 commit 05e1d75
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/bob/artifact/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,13 @@

(comment
(docker/ops (docker/client {:category :containers :conn states/docker-conn}))
(slurp (clojure.java.io/input-stream (java.io.ByteArrayInputStream. (.getBytes (docker/invoke states/containers {:op :ContainerArchive :params {:id "0be7b883382b" :path "/opt/pyproject.toml"} :as :stream}) "UTF-8"))))
(slurp (clojure.java.io/input-stream (java.io.ByteArrayInputStream.
(.getBytes
(docker/invoke states/containers {:op :ContainerArchive
:params
{:id "0be7b883382b"
:path "/opt/pyproject.toml"}
:as :stream}) "UTF-8"))))
(upload-artifact "dev" "test" 1 "poetry.lock" "0be7b883382b" "/opt" "s3")

(db/register-artifact-store states/db {:name "s3"
Expand Down
10 changes: 5 additions & 5 deletions src/bob/resource/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
- Copies over the contents to the home dir inside the container.
- Returns the id or the error."
[resource pipeline image]
(f/try-all [_ (when (not (r/valid-external-resource? resource))
(f/fail (str "Invalid external resources, possibly not registered"
(:name resource))))
out-dir (r/fetch-resource resource pipeline)]
(r/initial-image-of out-dir image nil)
(f/try-all [_ (when (not (r/valid-external-resource? resource))
(f/fail (str "Invalid external resources, possibly not registered"
(:name resource))))
archive-path (r/fetch-resource resource pipeline)]
(r/initial-image-of archive-path image nil)
(f/when-failed [err]
(log/errorf "Failed to generate mounted image: %s" (f/message err))
err)))
Expand Down

0 comments on commit 05e1d75

Please sign in to comment.