 
 (defn update-jenkins-url
     [job-config-url jenkins-auth]
-    (cond (.startsWith job-config-url "https://") (str "https://" jenkins-auth "@" (subs job-config-url 8))
-          (.startsWith job-config-url "http://")  (str "http://"  jenkins-auth "@" (subs job-config-url 7))
-          :else job-config-url))
+    (if (empty? jenkins-auth)
+        job-config-url
+        (cond (.startsWith job-config-url "https://") (str "https://" jenkins-auth "@" (subs job-config-url 8))
+              (.startsWith job-config-url "http://")  (str "http://"  jenkins-auth "@" (subs job-config-url 7))
+              :else job-config-url)))
 
 (defn post-command
     [jenkins-url jenkins-auth job-name command]

    [jenkins-url jenkins-auth job-name]
    (job-related-command jenkins-url jenkins-auth job-name "doDelete"))


             :message (.getMessage e)
            })))

(defn update-template
    [template git-repo branch]
    (-> template
        (clojure.string/replace "<placeholder id=\"git-repo\" />" git-repo)
        (clojure.string/replace "<placeholder id=\"git-branch\" />" (str "*/" branch))))

(defn start-job
    [jenkins-url jenkins-auth job-name]
    (job-related-command jenkins-url jenkins-auth job-name "build"))
