Created
May 10, 2019 19:31
-
-
Save jacobobryant/9c13f4cd692ff69d8f87b0d872aeb64e to your computer and use it in GitHub Desktop.
Script for automating Datomic Cloud Ion push + deploy
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
#!/usr/bin/planck | |
(ns deploy.core | |
(:require [cljs.reader :refer [read-string]] | |
[planck.shell :as shell])) | |
(defn sh [& args] | |
(let [result (apply shell/sh args)] | |
(if (= 0 (:exit result)) | |
(:out result) | |
(throw (ex-info (:err result) {}))))) | |
(let [push-out (sh "clojure" "-A:dev" "-m" "datomic.ion.dev" "{:op :push}") ; optionally: :uname \"$(uuidgen)\" | |
_ (print push-out) | |
deploy-cmd (get-in (read-string (str "[" push-out "]")) [1 :deploy-command]) | |
deploy-out (sh "bash" "-c" deploy-cmd) | |
_ (print deploy-out) | |
status-cmd (:status-command (read-string deploy-out))] | |
(println "Monitoring deployment; press Ctrl-C to exit.") | |
(while true | |
(print (sh "bash" "-c" status-cmd)) | |
(sh "sleep" "5"))) |
Nice work man...
Will try it next week.
jacobobryant <[email protected]> schrieb am Fr., 21. Juni 2019,
17:05:
… @rbubke <https://github.com/rbubke> glad to hear it! I've since adapted
this into a pure Clojure version which you may be interested in. It runs a
lot faster since you don't have to start up a new JVM for each command.
https://github.com/jacobobryant/trident/blob/master/src/trident/ion_dev/deploy.clj
It can be run with:
clj -Sdeps '{:deps {trident/ion-dev {:mvn/version "0.1.7"}}
:mvn/repos {"datomic-cloud" {:url "s3://datomic-releases-1fc2183a/maven/releases"}}}' \
-m trident.ion-dev.deploy --help
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://gist.github.com/9c13f4cd692ff69d8f87b0d872aeb64e?email_source=notifications&email_token=AA3NLDISCQTQB7H63DAIWYTP3TU5HA5CNFSM4H2PLOV2YY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAFUCJG#gistcomment-2950291>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3NLDLYXIIZ6MHWSGQURS3P3TU5HANCNFSM4H2PLOVQ>
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@rbubke glad to hear it! I've since adapted this into a pure Clojure version which you may be interested in. It runs a lot faster since you don't have to start up a new JVM for each command. https://github.com/jacobobryant/trident/blob/master/src/trident/ion_dev/deploy.clj
It can be run with: