Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevebuik
Last active January 10, 2019 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevebuik/7685cb328f65d98f4c229c1bc2b9bd27 to your computer and use it in GitHub Desktop.
Save stevebuik/7685cb328f65d98f4c229c1bc2b9bd27 to your computer and use it in GitHub Desktop.
(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