aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex/command/deploy.lux
blob: 504a9206ff7b3a53d69707010d769f669dd51e5b (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
(.using
 [library
  [lux "*"
   [abstract
    [monad {"+" do}]]
   [control
    [try {"+" Try}]
    [concurrency
     [async {"+" Async}]]]
   [world
    [program {"+" Program}]
    [shell {"+" Shell}]
    ["[0]" file]
    ["[0]" console {"+" Console}]]]]
 ["[0]" / "_"
  ["[1][0]" snapshot]
  ["[1][0]" release]
  ["/[1]" // "_"
   ["/[1]" // "_"
    [command {"+" Command}]
    [repository {"+" Repository}]
    [artifact {"+" Artifact}]
    ["/" profile]
    ["[1][0]" action]]]])

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

(def: .public (do! program shell console local remote fs artifact profile)
  (-> (Program 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! program shell console local remote fs artifact profile))]
    (is (Async (Try Any))
        (console.write_line ..success console))))