aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/deploy.lux
blob: c4dfe7c7dd611c8908fbc017792b6549a88e1088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
(.require
 [library
  [lux (.except)
   [abstract
    [monad (.only do)]]
   [control
    [try (.only Try)]
    [concurrency
     [async (.only Async)]]]
   [world
    [environment (.only Environment)]
    [shell (.only Shell)]
    ["[0]" file]
    ["[0]" console (.only Console)]]]]
 ["[0]" /
  ["[1][0]" snapshot]
  ["[1][0]" release]
  ["/[1]" //
   ["/[1]" //
    [command (.only Command)]
    [repository (.only Repository)]
    [artifact (.only Artifact)]
    ["/" profile]
    ["[1][0]" action]]]])

(def .public success
  "Successfully deployed the project.")

(def .public (do! environment shell console local remote fs artifact profile)
  (-> (Environment Async) (Shell Async) (Console Async) (Repository Async) (Repository Async) (file.System Async) Artifact (Command Any))
  (do [! ///action.monad]
    [_ (if (/snapshot.snapshot? artifact)
         (/snapshot.do! console remote fs artifact profile)
         (/release.do! environment shell console local remote fs artifact profile))]
    (is (Async (Try Any))
        (console.write_line ..success console))))