From cd8412285c09f0481818091320d1893f5c054d65 Mon Sep 17 00:00:00 2001 From: Josha von Gizycki Date: Tue, 18 Dec 2018 22:11:29 +0100 Subject: [PATCH] fix joshavgde pipeline --- src/wanijo_pipeline/joshavgde_pipeline.clj | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/wanijo_pipeline/joshavgde_pipeline.clj b/src/wanijo_pipeline/joshavgde_pipeline.clj index 6637d2b..fce1c61 100644 --- a/src/wanijo_pipeline/joshavgde_pipeline.clj +++ b/src/wanijo_pipeline/joshavgde_pipeline.clj @@ -4,18 +4,31 @@ [lambdacd.steps.shell :as lcd-shell] [lambdacd-git.core :as lcd-git])) -(defn pull [args ctx] - (lcd-shell/bash ctx "/opt/wedder" "git pull")) +(def repo-uri "https://gitea.heevyis.ninja/josha/equilibrium.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 render [args ctx] - (lcd-shell/bash ctx "/opt/wedder" "lein equilibrium render")) + (lcd-shell/bash ctx (:cwd args) "lein equilibrium render")) (defn deploy [args ctx] (lcd-shell/bash ctx (:cwd args) "lein equilibrium deploy")) (def pipeline-def - `(manualtrigger/wait-for-manual-trigger + `((either + manualtrigger/wait-for-manual-trigger + wait-for-repo) (with-workspace - pull + clone render deploy)))