Cleanup, ensure Clojure types instead of Java types
This commit is contained in:
parent
d9e9b9724d
commit
92386aa9cf
1 changed files with 7 additions and 7 deletions
|
|
@ -16,22 +16,22 @@
|
||||||
[{:keys [container exposed-ports env-vars command]}]
|
[{:keys [container exposed-ports env-vars command]}]
|
||||||
(.setExposedPorts container (map int exposed-ports))
|
(.setExposedPorts container (map int exposed-ports))
|
||||||
|
|
||||||
(when (some? env-vars)
|
(run! (fn [[k v]] (.addEnv container k v)) env-vars)
|
||||||
(doseq [pair env-vars]
|
|
||||||
(.addEnv container (first pair) (second pair))))
|
|
||||||
|
|
||||||
(when (some? command)
|
(when command
|
||||||
(.setCommand container command))
|
(.setCommand container command))
|
||||||
|
|
||||||
{:container container
|
{:container container
|
||||||
:exposed-ports (.getExposedPorts container)
|
:exposed-ports (vec (.getExposedPorts container))
|
||||||
:env-vars (.getEnvMap container)
|
:env-vars (into {} (.getEnvMap container))
|
||||||
:host (.getHost container)})
|
:host (.getHost container)})
|
||||||
|
|
||||||
(defn create
|
(defn create
|
||||||
"Creates a generic testcontainer and sets its properties"
|
"Creates a generic testcontainer and sets its properties"
|
||||||
[{:keys [image-name] :as options}]
|
[{:keys [image-name] :as options}]
|
||||||
(init (assoc options :container (GenericContainer. image-name))))
|
(->> (GenericContainer. image-name)
|
||||||
|
(assoc options :container)
|
||||||
|
init))
|
||||||
|
|
||||||
(defn map-classpath-resource!
|
(defn map-classpath-resource!
|
||||||
"Maps a resource in the classpath to the given container path. Should be called before starting the container!"
|
"Maps a resource in the classpath to the given container path. Should be called before starting the container!"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue