-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.fs
More file actions
65 lines (49 loc) · 1.58 KB
/
Build.fs
File metadata and controls
65 lines (49 loc) · 1.58 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
open Fake.Core
open Fake.IO
open Farmer
open Farmer.Builders
open Helpers
initializeContext ()
let sharedPath = Path.getFullName "src/Shared"
let serverPath = Path.getFullName "src/Server"
let clientPath = Path.getFullName "src/Client"
let deployPath = Path.getFullName "deploy"
let sharedTestsPath = Path.getFullName "tests/Shared"
let serverTestsPath = Path.getFullName "tests/Server"
let clientTestsPath = Path.getFullName "tests/Client"
Target.create "Clean" (fun _ ->
Shell.cleanDir deployPath
run dotnet "fable clean --yes" clientPath // Delete *.fs.js files created by Fable
)
Target.create "Bundle" (fun _ ->
[ "server", dotnet $"publish -c Release -o \"{deployPath}\"" serverPath
"client", dotnet "perla build" clientPath ]
|> runParallel)
Target.create "Azure" (fun _ ->
let web =
webApp {
name "SafePerla"
operating_system OS.Windows
runtime_stack Runtime.DotNet60
zip_deploy "deploy"
}
let deployment =
arm {
location Location.WestEurope
add_resource web
}
deployment
|> Deploy.execute "SafePerla" Deploy.NoParameters
|> ignore)
Target.create "Run" (fun _ ->
run dotnet "build" sharedPath
[ "server", dotnet "watch run" serverPath
"client", dotnet "perla serve" clientPath ]
|> runParallel)
Target.create "Format" (fun _ -> run dotnet "fantomas . -r" "src")
open Fake.Core.TargetOperators
let dependencies =
[ "Clean" ==> "Bundle" ==> "Azure"
"Clean" ==> "Run" ]
[<EntryPoint>]
let main args = runOrDefault args