|
|
@ -4,19 +4,8 @@
|
|
|
|
[lambdacd.steps.shell :as lcd-shell]
|
|
|
|
[lambdacd.steps.shell :as lcd-shell]
|
|
|
|
[lambdacd-git.core :as lcd-git]))
|
|
|
|
[lambdacd-git.core :as lcd-git]))
|
|
|
|
|
|
|
|
|
|
|
|
(def repo-uri "https://gitea.heevyis.ninja/josha/wedder.git")
|
|
|
|
(defn pull [args ctx]
|
|
|
|
(def repo-branch "master")
|
|
|
|
(lcd-shell/bash ctx "/opt/wedder" "git pull"))
|
|
|
|
|
|
|
|
|
|
|
|
(defn wait-for-repo [args ctx]
|
|
|
|
|
|
|
|
(lcd-git/wait-for-git ctx
|
|
|
|
|
|
|
|
repo-uri
|
|
|
|
|
|
|
|
:ref (str "refs/heads/" repo-branch)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn clone [args ctx]
|
|
|
|
|
|
|
|
(let [revision (:revision args)
|
|
|
|
|
|
|
|
cwd (:cwd args)
|
|
|
|
|
|
|
|
ref (or revision repo-branch)]
|
|
|
|
|
|
|
|
(lcd-git/clone ctx repo-uri ref cwd)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defn lein [target args ctx]
|
|
|
|
(defn lein [target args ctx]
|
|
|
|
(lcd-shell/bash ctx (:cwd args) (str "lein " target)))
|
|
|
|
(lcd-shell/bash ctx (:cwd args) (str "lein " target)))
|
|
|
@ -25,17 +14,15 @@
|
|
|
|
(lein "uberjar" args ctx))
|
|
|
|
(lein "uberjar" args ctx))
|
|
|
|
|
|
|
|
|
|
|
|
(defn kill-previous [args ctx]
|
|
|
|
(defn kill-previous [args ctx]
|
|
|
|
(lcd-shell/bash ctx "pkill -f wedder"))
|
|
|
|
(lcd-shell/bash ctx (:cwd args) "pkill -f wedder"))
|
|
|
|
|
|
|
|
|
|
|
|
(defn deploy [args ctx]
|
|
|
|
(defn deploy [args ctx]
|
|
|
|
(lcd-shell/bash ctx "/opt/wedder" "nohup java -jar target/wedder-0.1.0-SNAPSHOT.jar"))
|
|
|
|
(lcd-shell/bash ctx "/opt/wedder" "nohup java -jar target/wedder-0.1.0-SNAPSHOT.jar"))
|
|
|
|
|
|
|
|
|
|
|
|
(def pipeline-def
|
|
|
|
(def pipeline-def
|
|
|
|
`((either
|
|
|
|
`(manualtrigger/wait-for-manual-trigger
|
|
|
|
manualtrigger/wait-for-manual-trigger
|
|
|
|
|
|
|
|
wait-for-repo)
|
|
|
|
|
|
|
|
(with-workspace
|
|
|
|
(with-workspace
|
|
|
|
clone
|
|
|
|
pull
|
|
|
|
compile
|
|
|
|
compile
|
|
|
|
kill-previous
|
|
|
|
kill-previous
|
|
|
|
deploy)))
|
|
|
|
deploy)))
|
|
|
|