fix spec tg
This commit is contained in:
parent
897fe85e61
commit
62dbf600fd
2 changed files with 21 additions and 18 deletions
src/dda/build
|
@ -1,42 +1,46 @@
|
|||
(ns dda.build.terragrunt
|
||||
(:require [orchestra.core :refer [defn-spec]]
|
||||
(:require [clojure.spec.alpha :as s]
|
||||
[orchestra.core :refer [defn-spec]]
|
||||
[clojure.spec.test.alpha :as st]
|
||||
[cheshire.core :refer [parse-string]]
|
||||
[dda.build.devops :as d]
|
||||
[dda.build.terragrunt.domain :as domain]
|
||||
[dda.build.infrastructure :as i]))
|
||||
|
||||
(st/instrument `clean-build-dir!)
|
||||
|
||||
(def default
|
||||
(merge d/default {:autoapply false
|
||||
:tg-output-filenname "tg-out.json"}))
|
||||
(merge d/default
|
||||
{:tg-output-filenname "tg-out.json"}))
|
||||
|
||||
(s/def ::tg (s/merge
|
||||
::d/devops
|
||||
(s/keys :opt-un [::domain/tg-output-filenname])))
|
||||
(s/def ::tf-out ::domain/tf-out)
|
||||
|
||||
(defn-spec clean-build-dir! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(i/execute! (domain/clean-build-dir-command config) config)))
|
||||
|
||||
(defn-spec copy-terragrunt! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(doseq [c (domain/copy-terragrunt-command config)]
|
||||
(i/execute! c config))))
|
||||
|
||||
(defn-spec terragrunt-plan! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(doseq [c (domain/terragrunt-plan-command config)]
|
||||
(i/execute! c config))))
|
||||
|
||||
(defn-spec terragrunt-apply! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(doseq [c (domain/terragrunt-apply-command config)]
|
||||
(i/execute! c config))))
|
||||
|
||||
(defn-spec terragrunt-output! map?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(doseq [c (domain/terragrunt-output-command config)]
|
||||
(i/execute! c config))
|
||||
|
@ -44,13 +48,13 @@
|
|||
(fn [k] (keyword (.toLowerCase k))))))
|
||||
|
||||
(defn-spec terragrunt-destroy! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(doseq [c (domain/terragrunt-destroy-command config)]
|
||||
(i/execute! c config))))
|
||||
|
||||
(defn-spec plan! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(clean-build-dir! config)
|
||||
(d/create-build-dir! config)
|
||||
|
@ -58,7 +62,7 @@
|
|||
(terragrunt-plan! config)))
|
||||
|
||||
(defn-spec apply! map?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(clean-build-dir! config)
|
||||
(d/create-build-dir! config)
|
||||
|
@ -67,7 +71,7 @@
|
|||
(terragrunt-output! config)))
|
||||
|
||||
(defn-spec destroy! nil?
|
||||
[devops ::d/devops]
|
||||
[devops ::tg]
|
||||
(let [config (merge default devops)]
|
||||
(clean-build-dir! config)
|
||||
(d/create-build-dir! config)
|
||||
|
|
|
@ -21,12 +21,11 @@
|
|||
(s/keys :req-un [::out]))
|
||||
|
||||
(s/def ::tg-output-filenname string?)
|
||||
(s/def ::autoapply boolean?)
|
||||
|
||||
(s/def ::config
|
||||
(s/keys :req-un [::d/name ::d/stage ::d/project-root-path ::d/build-dir-name ::d/debug
|
||||
::d/dry-run ::d/module ::tg-output-filenname ::autoapply]
|
||||
:opt-un []))
|
||||
(s/merge ::d/devops
|
||||
(s/keys :req-un [::tg-output-filenname]
|
||||
:opt-un [])))
|
||||
|
||||
(defn-spec clean-build-dir-command seq?
|
||||
[config ::config]
|
||||
|
|
Loading…
Add table
Reference in a new issue