Last active
January 10, 2019 09:32
-
-
Save stevebuik/7685cb328f65d98f4c229c1bc2b9bd27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn release | |
"Do push and deploy of app. Supports stable and unstable releases. Returns when deploy finishes running." | |
[args] | |
(try | |
(println "Pushing..") | |
(let [push-data (ion-dev/push args) | |
deploy-args (merge (select-keys args [:creds-profile :region :uname]) | |
(select-keys push-data [:rev]) | |
{:group group})] | |
(println "Deploying..") | |
(let [deploy-data (ion-dev/deploy deploy-args) | |
deploy-status-args (merge (select-keys args [:creds-profile :region]) | |
(select-keys deploy-data [:execution-arn]))] | |
(loop [poll-count 1] | |
(println (str poll-count ": Polling deploy..")) | |
(let [status-data (ion-dev/deploy-status deploy-status-args)] | |
(if (= "RUNNING" (:code-deploy-status status-data)) | |
(do (Thread/sleep 5000) (recur (inc poll-count))) | |
status-data))))) | |
(catch Exception e | |
{:deploy-status "ERROR" | |
:message (.getMessage e)}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment