This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-04-28
Channels
- # beginners (35)
- # boot (5)
- # cider (16)
- # cljs-dev (22)
- # cljsrn (11)
- # clojars (1)
- # clojure (205)
- # clojure-uk (19)
- # clojurescript (76)
- # cursive (22)
- # duct (4)
- # editors (1)
- # emacs (4)
- # fulcro (1)
- # hoplon (3)
- # leiningen (5)
- # off-topic (25)
- # onyx (29)
- # other-languages (5)
- # parinfer (1)
- # re-frame (13)
- # reagent (8)
- # reitit (2)
- # shadow-cljs (3)
- # tools-deps (11)
- # vim (6)
Morning ๐
Hey @dominicm, Iโm playing around with mach and pack.alphaโฆ
How would you ensure that novelty in any file under src
or deps.edn
would trigger a rebuild
Ah, the source
in modified-since
can be a collection. Think that solves my problem
๐ 4
Someone wrote a nice blog about using clj
to build from scratch. Iโm making corresponding mach recipes
https://oli.me.uk/2018-02-26-clojure-projects-from-scratch/
๐ 8
{image {novelty (first (for [images (clojure.string/split
(let [child_process (js/require "child_process")]
(str (.-stdout
(.spawnSync child_process
"docker"
(clj->js ["images" "--format" "{{.Repository}}\t{{.ID}}\t{{.CreatedAt}}"])))))
#"\n")
:let [[repository id created-at] (clojure.string/split images #"\t")]
:when (= "kermit-reporting-db" repository)]
(some (partial mach.core/modified-since? (new js/Date created-at))
["Dockerfile" "001-init.sql" "002-olap-schema.sql" "003-permissions.sql"])))
update! #$ ["docker" "build" "-t" "kermit-reporting-db" "."]}
run {depends [image]
update! #$ ["./run-image"]}}
It predates the async changes that were made to mach.๐ 4
Essentially it parses that date out of the docker command output, and then compares that date to now
Not much of a blogger but I made a little git repo with my experiment: https://github.com/cddr/mach-clj-demo
๐ 8