{mach/m2 [[aero "1.1.2"]
          [roll "0.0.6-SNAPSHOT"]]

 mach/props [config (:deployment (aero.core/read-config "resources/config.edn" {:profile :prod}))
             version #$ ["git" "describe" "--dirty" "--long" "--tags" "--match" "[0-9]*"]
             s3-artefact (str "edge-" version "-standalone.jar")
             uberjar "target/edge-app.jar"]

 ;; Useful AWS targets
 mach/import [["https://raw.githubusercontent.com/juxt/mach/master/extensions/aws.mach.edn"
               {aws-profile (:aws-profile config)}]]

 info (println "S3 Release Artefact:" s3-artefact)
 roll-info (clojure.pprint/pprint (roll.core/preprocess config))

 uberjar {product uberjar
          novelty (not (mach.core/file-exists? uberjar))
          produce  #$ ["boot uberjar"]}

 upload {depends [uberjar]
         update! (roll.core/upload! config uberjar s3-artefact version)}

 tfjson {product "deployment.tf.json"
         novelty (mach.core/modified-since product ["Machfile.edn" "resources/config.edn"])
         produce (-> config
                     (roll.core/preprocess)
                     (roll.core/deployment->tf)
                     (roll.core/->tf-json))}}

{mach/m2 [[aero "1.1.2"]
          [roll "0.0.6-SNAPSHOT"]]

 mach/props [config (:deployment (aero.core/read-config "resources/config.edn" {:profile :prod}))
             version (roll.core/git-version)
             s3-artefact (str "edge-" version "-standalone.jar")
             uberjar "target/edge-app.jar"]

 ;; Useful AWS targets
 mach/import [["https://raw.githubusercontent.com/juxt/mach/master/extensions/aws.mach.edn"
               {aws-profile (:aws-profile config)}]]

 info (println "S3 Release Artefact:" s3-artefact)
 roll-info (clojure.pprint/pprint (roll.core/preprocess config))

 uberjar {product uberjar
          novelty (not (mach.core/file-exists? uberjar))
          produce  #$ ["boot uberjar"]}

 upload {depends [uberjar]
         update! (roll.core/upload! config uberjar s3-artefact version)}

 tfjson {product "deployment.tf.json"
         novelty (mach.core/modified-since product ["Machfile.edn" "resources/config.edn"])
         produce (-> config
                     (roll.core/preprocess)
                     (roll.core/deployment->tf)
                     (roll.core/->tf-json))}}
