cp * is not working

This commit is contained in:
Michael Jerger 2024-07-30 18:57:44 +02:00
parent e0b5eb0ee3
commit 6046554be4
4 changed files with 14 additions and 7 deletions

View file

@ -4,10 +4,10 @@
[dda.build.devops.domain :as d]))
(defn-spec execute nil?
[command string?
[command seq?
devops ::d/devops]
(let [{:keys [dry-run debug]} devops]
(when debug
(println command))
(when-not dry-run
(apply t/shell command))))
(apply t/shell command))))

View file

@ -12,5 +12,10 @@
(let [final (merge default devops)]
(i/execute (domain/clean-build-dir-command final) final)
(d/create-build-dir final)
(i/execute (domain/copy-terragrunt-command final) final)
(i/execute ["ls" "-la"] final)
(doseq [c (domain/copy-terragrunt-command final)]
(try (i/execute c final)
(catch Exception e (str "caught exception: " (.getMessage e)))))
(i/execute [{:dir "../../../target/test/statistics"} "terragrunt" "init"] final)
(i/execute [{:dir "../../../target/test/statistics"} "terragrunt" "plan"] final)
))

View file

@ -13,5 +13,7 @@
(defn-spec copy-terragrunt-command seq?
[devops ::devops]
(let [{:keys [module]} devops]
["cp" "." (d/build-path devops) "&&" "cp" module (d/build-path devops)]))
(let [{:keys [module]} devops
devops-wo-module (dissoc devops :module)]
[["cp" "*.hcl" (d/build-path devops-wo-module)]
["cp" "-r" module (d/build-path devops-wo-module)]]))

View file

@ -19,8 +19,8 @@
:dry-run false}))))
(deftest should-calculate-copy-terragrunt-command
(is (= ["cp" "." "../../target/test/statistics" "&&"
"cp" "statistics" "../../target/test/statistics"]
(is (= [["cp" "*.hcl" "../../target/test"]
["cp" "-r" "statistics" "../../target/test"]]
(cut/copy-terragrunt-command {:name "test"
:module "statistics"
:project-root-path "../.."