-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modelled after clojure-emacs/cider-nrepl#745
- Loading branch information
Showing
5 changed files
with
103 additions
and
31 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
(ns deploy-release | ||
(:require | ||
[clojure.java.shell :refer [sh]] | ||
[clojure.string :as str])) | ||
|
||
(def release-marker "v") | ||
|
||
(defn make-version [tag] | ||
(str/replace-first tag release-marker "")) | ||
|
||
(defn log-result [m] | ||
(println m) | ||
m) | ||
|
||
(defn -main [& _] | ||
(let [tag (System/getenv "CIRCLE_TAG")] | ||
(if-not tag | ||
(do | ||
(println "No CIRCLE_TAG found.") | ||
(System/exit 1)) | ||
(if-not (re-find (re-pattern release-marker) tag) | ||
(do | ||
(println (format "The `%s` marker was not found in %s." release-marker tag)) | ||
(System/exit 1)) | ||
(let [version (make-version tag)] | ||
(apply println "Executing" *command-line-args*) | ||
(->> [:env (-> {} | ||
(into (System/getenv)) | ||
(assoc "PROJECT_VERSION" version) | ||
(dissoc "CLASSPATH"))] | ||
(into (vec *command-line-args*)) | ||
(apply sh) | ||
log-result | ||
:exit | ||
(System/exit))))))) |
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
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
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