 
 (defn deployment-tasks
   [deployment-id]
-  (nil-if-no-deployment deployment-id (->> (esd/search @conn index-name task-type :routing deployment-id :query (q/match-all) :filter (parent-filter deployment-type deployment-id) :sort {:sequence "asc"} :size 10000)
+  (nil-if-no-deployment deployment-id (->> (esd/search @conn index-name task-type :query (q/match-all) :filter (parent-filter deployment-type deployment-id) :sort {:sequence "asc"} :size 10000)
                                            esrsp/hits-from
                                            (map (fn [h] (assoc (:_source h) :id (:_id h))))
                                            (map #(dissoc % :sequence)))))


(defn write-log
  [log-id deployment-id document]
  (esd/create @conn index-name log-type (dissoc document :id) :id log-id :parent deployment-id :refresh true))

(defn nil-if-no-deployment
  [deployment-id results]


(defn deployment
  [deployment-id]
  (when-let [document (:_source (esd/get @conn index-name deployment-type deployment-id))]
    (assoc document :id deployment-id)))

(defn delete-deployment
