using tasks

This commit is contained in:
Michael Jerger 2024-03-06 11:52:10 +01:00
parent 52db785f8b
commit e9262382c4
3 changed files with 5 additions and 6 deletions

5
bb.edn
View file

@ -1,2 +1,5 @@
{:deps {dda/dda-devops-build {:local/root "."}}} {:deps {dda/dda-devops-build {:local/root "."}}
:tasks
{:requires ([dda.devops-build.main :as main])
image-build (apply main/build *command-line-args*)}}

View file

@ -1,6 +1,2 @@
#!/usr/bin/env bb #!/usr/bin/env bb
(require '[dda.devops-build.main :as build])
(when (= *file* (System/getProperty "babashka.file"))
(apply build/-main *command-line-args*))

View file

@ -10,7 +10,7 @@
(s/explain spec args) (s/explain spec args)
(println (str "Bad commandline arguments\n"))) (println (str "Bad commandline arguments\n")))
(defn -main [& cmd-args] (defn build [& cmd-args]
(let [parsed-args-cmd (s/conform ::cmd-args cmd-args)] (let [parsed-args-cmd (s/conform ::cmd-args cmd-args)]
(if (= ::s/invalid parsed-args-cmd) (if (= ::s/invalid parsed-args-cmd)
(invalid-args-msg ::cmd-args cmd-args) (invalid-args-msg ::cmd-args cmd-args)