From d4b37360dcc8352beff98ba91d00294a4bafb6aa Mon Sep 17 00:00:00 2001 From: Daniel Ziltener Date: Mon, 9 Dec 2019 16:53:02 +0100 Subject: [PATCH] nginx fix --- src/com/sompani/onboarding.clj | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/com/sompani/onboarding.clj b/src/com/sompani/onboarding.clj index b22a937..f1a1393 100644 --- a/src/com/sompani/onboarding.clj +++ b/src/com/sompani/onboarding.clj @@ -19,6 +19,8 @@ ;; # Webserver configuration +;; ## Deployment directory structure + (defn- set-owner [path owner] (-> (Files/getFileAttributeView path PosixFileAttributeView (into-array LinkOption [LinkOption/NOFOLLOW_LINKS])) @@ -67,15 +69,16 @@ ;; (set-group link group) ))) +;; ## nginx configuration + (defn create-nginx-server! [datamap] (doseq [file ["skel.talent.careers" "staging.skel.talent.careers"] :let [in-file (str "resources/nginx/" file) out-file (format "/etc/nginx/servers-available/%s" (str/replace file #"skel" (:company-name datamap)))]] (info "using template" in-file "to create" out-file) - (-> (slurp in-file) - (cljstache/render datamap) - (spit out-file)))) + (spit out-file + (cljstache/render (slurp in-file) datamap)))) ;; # DNS configuration @@ -101,6 +104,8 @@ :content-type :json :form-params entry}))))) +;; # Main initialization + (defn -main [& args] (let [datamap {:company-name (nth args 0) :company-suffix (nth args 1)}]