Skip to content

Instantly share code, notes, and snippets.

@stevebuik
Last active Jan 10, 2019
Embed
What would you like to do?
(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