diff --git a/src/wanijo_pipeline/core.clj b/src/wanijo_pipeline/core.clj index f577c81..99db057 100644 --- a/src/wanijo_pipeline/core.clj +++ b/src/wanijo_pipeline/core.clj @@ -36,6 +36,7 @@ (defn -main [& args] (let [wanijo-pipeline (wanijo-pipeline) formulare-pipeline (formulare-pipeline) + wedder-pipeline (wedder-pipeline) app (ui-selection/ui-routes wanijo-pipeline formulare-pipeline wedder-pipeline)] @@ -43,5 +44,6 @@ ;; there are other runners and you can define your own as well. (runners/start-one-run-after-another wanijo-pipeline) (runners/start-one-run-after-another formulare-pipeline) + (runners/start-one-run-after-another wedder-pipeline) ;; start the webserver to serve the UI (http-kit/run-server app {:port 30500}))) diff --git a/src/wanijo_pipeline/ui_selection.clj b/src/wanijo_pipeline/ui_selection.clj index 83c5102..81535f9 100644 --- a/src/wanijo_pipeline/ui_selection.clj +++ b/src/wanijo_pipeline/ui_selection.clj @@ -15,7 +15,8 @@ [:h1 "LambdaCD - UI Selection"] [:ul [:li [:a {:href "./wanijo/lambdaui/index.html"} "Wanijo"]] - [:li [:a {:href "./formulare/lambdaui/index.html"} "Formulare"]]]]])) + [:li [:a {:href "./formulare/lambdaui/index.html"} "Formulare"]] + [:li [:a {:href "./wedder/lambdaui/index.html"} "Wedder"]]]]])) (defn ui-routes [wanijo formulare wedder] (let [wanijo-app (lambdaui/ui-for wanijo :contextPath "/wanijo") diff --git a/src/wanijo_pipeline/wedder_pipeline.clj b/src/wanijo_pipeline/wedder_pipeline.clj index 0a2c2f4..73be0e0 100644 --- a/src/wanijo_pipeline/wedder_pipeline.clj +++ b/src/wanijo_pipeline/wedder_pipeline.clj @@ -4,19 +4,8 @@ [lambdacd.steps.shell :as lcd-shell] [lambdacd-git.core :as lcd-git])) -(def repo-uri "https://gitea.heevyis.ninja/josha/wedder.git") -(def repo-branch "master") - -(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 pull [args ctx] + (lcd-shell/bash ctx "/opt/wedder" "git pull")) (defn lein [target args ctx] (lcd-shell/bash ctx (:cwd args) (str "lein " target))) @@ -25,17 +14,15 @@ (lein "uberjar" 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] (lcd-shell/bash ctx "/opt/wedder" "nohup java -jar target/wedder-0.1.0-SNAPSHOT.jar")) (def pipeline-def - `((either - manualtrigger/wait-for-manual-trigger - wait-for-repo) + `(manualtrigger/wait-for-manual-trigger (with-workspace - clone + pull compile kill-previous deploy)))