Prevent initial execution from wiping app deployments unnecessarily
This commit is contained in:
@@ -28,9 +28,18 @@
|
|||||||
_ (.setConfig core-stack "hetzner-k3s:sshPersonalKeyName" #js {:value (-> cfg :sshPersonalKeyName) :secret false})
|
_ (.setConfig core-stack "hetzner-k3s:sshPersonalKeyName" #js {:value (-> cfg :sshPersonalKeyName) :secret false})
|
||||||
_ (.setConfig core-stack "hcloud:token" #js {:value (-> cfg :hcloudToken) :secret true})
|
_ (.setConfig core-stack "hcloud:token" #js {:value (-> cfg :hcloudToken) :secret true})
|
||||||
_ (.setConfig core-stack "hetzner-k3s:privateKeySsh" #js {:value (-> cfg :privateKeySsh) :secret true})
|
_ (.setConfig core-stack "hetzner-k3s:privateKeySsh" #js {:value (-> cfg :privateKeySsh) :secret true})
|
||||||
core-result (.up core-stack #js {:onOutput println})
|
;;core-result (.up core-stack #js {:onOutput println})
|
||||||
|
|
||||||
|
;; Checks for changes on the core and prevents deleting the app-stack needlessly.
|
||||||
|
;; Important for the Openbao vault as it is deployed here and configured on the app-stack generally
|
||||||
|
core-preview-result (.preview core-stack #js {:onOutput println})
|
||||||
|
core-change-summary (js->clj (.-changeSummary core-preview-result) :keywordize-keys true)
|
||||||
|
core-result (when (or (zero? (:delete core-change-summary 0))
|
||||||
|
(pos? (:update core-change-summary 0))
|
||||||
|
(pos? (:create core-change-summary 0)))
|
||||||
|
(.up core-stack #js {:onOutput println}))
|
||||||
core-outputs (.outputs core-stack)
|
core-outputs (.outputs core-stack)
|
||||||
|
|
||||||
vault-address (-> core-outputs (aget "vaultAddress") (.-value))
|
vault-address (-> core-outputs (aget "vaultAddress") (.-value))
|
||||||
vault-token (-> core-outputs (aget "vaultToken") (.-value))
|
vault-token (-> core-outputs (aget "vaultToken") (.-value))
|
||||||
kubeconfig (-> core-outputs (aget "kubeconfig") (.-value))
|
kubeconfig (-> core-outputs (aget "kubeconfig") (.-value))
|
||||||
|
|||||||
Reference in New Issue
Block a user