 (defn round-up
   [{:keys [deploy-repository] :as comp}
    job]
-  (let [app (str (:repo-name job) "-" (:branch-name job))]
+  (let [app (->app job)]
     (deployrepo/delete-service deploy-repository {:app app})
     (deployrepo/delete-deployment deploy-repository {:app app})
     (deployrepo/remove-subdomain deploy-repository job)))

(defn- prepare-ingress
  [{:keys [deploy-repository domain]}
   {:keys [conf build user-name repo-name branch-name] :as job}]
  (let [host (str repo-name "-" branch-name "." domain)
        service-name (str repo-name "-" branch-name)
        ingress (deployrepo/get-ingress deploy-repository)
        spec (.getSpec ingress)
        tls (.getTls spec)

                   :repo repo-name
                   :ref branch-name
                   :path (-> conf :k8s :service)})
        app (->app job)]
    (-> service
        (assoc-in [:metadata :name] app)
        (assoc-in [:spec :selector :app] app))))
