   (:require [clojars.config :refer [config]]
             [clojars.maven :as maven]
             [clojure.java.io :as io]
+            [clojure.java.shell :as sh]
             [cemerick.pomegranate.aether :as aether]
             [clojars.db :as db]
             [korma.core :refer [select fields where update set-fields]])

    blockers
    (conj blockers (str "Missing " (name field)))))

(defn signed? [blockers file]
  ;; TODO: implement
  blockers)

(defn unpromoted? [blockers {:keys [group name version]}]
  (let [[{:keys [promoted_at]}] (select db/jars (fields :promoted_at)

                             :repository {"releases" releases})))

(defn promote [{:keys [group name version] :as info}]
  (sql/with-connection (config :db)
    (sql/transaction
     (let [blockers (blockers info)]
       (if (empty? blockers)
         (do
           (println "Promoting" info)
           (update db/jars
                   (set-fields {:promoted_at (java.util.Date.)})
                   (where {:group_name group :jar_name name :version version}))
           (deploy-to-s3 info))
         blockers)))))

(defonce queue (LinkedBlockingQueue.))

