introduce terragrunt
This commit is contained in:
parent
ae5ccc60f1
commit
e0b5eb0ee3
2 changed files with 38 additions and 7 deletions
|
@ -1,9 +1,8 @@
|
|||
(ns dda.build.terragrunt
|
||||
(:require [orchestra.core :refer [defn-spec]]
|
||||
[babashka.tasks :as t]
|
||||
[dda.build.devops :as d]
|
||||
[dda.build.devops.domain :as dd]
|
||||
[dda.build.terragrunt.domain :as dterra]))
|
||||
[dda.build.terragrunt.domain :as domain]
|
||||
[dda.build.infrastructure :as i]))
|
||||
|
||||
(def default
|
||||
(merge d/default {}))
|
||||
|
@ -11,7 +10,7 @@
|
|||
(defn-spec plan nil?
|
||||
[devops ::d/devops]
|
||||
(let [final (merge default devops)]
|
||||
(apply t/shell (dd/clean-build-dir-command final))
|
||||
(apply t/shell (dd/create-build-dir-command final))
|
||||
(apply t/shell (dterra/copy-terragrunt-command final))
|
||||
(apply t/shell (dterra/plan-command final))))
|
||||
(i/execute (domain/clean-build-dir-command final) final)
|
||||
(d/create-build-dir final)
|
||||
(i/execute (domain/copy-terragrunt-command final) final)
|
||||
))
|
||||
|
|
32
test/dda/build/terragrunt/domain_test.clj
Normal file
32
test/dda/build/terragrunt/domain_test.clj
Normal file
|
@ -0,0 +1,32 @@
|
|||
(ns dda.build.terragrunt.domain-test
|
||||
(:require
|
||||
[clojure.test :refer [deftest is are testing run-tests]]
|
||||
[clojure.spec.test.alpha :as st]
|
||||
[dda.build.terragrunt.domain :as cut]))
|
||||
|
||||
(st/instrument `cut/clean-build-dir-command)
|
||||
(st/instrument `cut/copy-terragrunt-command)
|
||||
|
||||
(deftest should-calculate-clean-build-dir-command
|
||||
(is (= ["rm" "-rf" "../../target/test"]
|
||||
(cut/clean-build-dir-command {:name "test"
|
||||
:module "statistics"
|
||||
:project-root-path "../.."
|
||||
:build-dir-name "target"
|
||||
:version "4.11.8-dev"
|
||||
:stage "dev"
|
||||
:debug false
|
||||
:dry-run false}))))
|
||||
|
||||
(deftest should-calculate-copy-terragrunt-command
|
||||
(is (= ["cp" "." "../../target/test/statistics" "&&"
|
||||
"cp" "statistics" "../../target/test/statistics"]
|
||||
(cut/copy-terragrunt-command {:name "test"
|
||||
:module "statistics"
|
||||
:project-root-path "../.."
|
||||
:build-dir-name "target"
|
||||
:version "4.11.8-dev"
|
||||
:stage "dev"
|
||||
:debug false
|
||||
:dry-run false}))))
|
||||
|
Loading…
Reference in a new issue