This repository has been archived by the owner on Jan 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
63 lines (53 loc) · 1.95 KB
/
build.fsx
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
// include Fake libs
#r "./packages/FAKE/tools/FakeLib.dll"
#r @"FakeLib.dll"
open Fake
open Fake.Azure
open Fake.EnvironmentHelper
open Fake.StringHelper
open Fake.ConfigurationHelper
open System
open System.IO
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let solutionFile = "DG.O365.Adoption.RulesEngine\DG.O365.Adoption.RulesEngine.fsproj"
let sqlConn = environVar "RulesSqlConnectionString"
let webappProj = "./DG.O365.Adoption.RulesEngine/DG.O365.Adoption.RulesEngine.fsproj"
Target "StageWebsiteAssets" (fun _ ->
let blacklist =
[ "typings"
".fs"
".references"
"tsconfig.json" ]
let shouldInclude (file:string) =
blacklist
|> Seq.forall(not << file.Contains)
Kudu.stageFolder (Path.GetFullPath @"DG.O365.Adoption.RulesEngine\WebHost") shouldInclude)
Target "BuildSolution" (fun _ ->
//updateConnectionString "SqlConnectionString" sqlConn "DG.O365.Adoption.RulesEngine\App.config"
solutionFile
|> MSBuildHelper.build (fun defaults ->
{ defaults with
Verbosity = Some Minimal
Targets = [ "Build" ]
Properties = [ "Configuration", "Release"
"OutputPath", Kudu.deploymentTemp ] })
|> ignore)
Target "Deploy" Kudu.kuduSync
Target "MSDeploy" (fun _ ->
webappProj
|> MSBuildHelper.build (fun defaults ->
{ defaults with
Verbosity = Some Minimal
Targets = [ "Build" ]
Properties = [ "Configuration", "Release"
"DeployOnBuild", "true"
"PublishProfile", "MSDeploy.pubxml"
"ProjectName", "DG.O365.Adoption.RulesEngine.MSDeploy"
"ConfigurationName", "Release"
"PackageLocation", "../../build/"
"OutDir", "../../build/"] })
|> ignore)
"StageWebsiteAssets"
==> "BuildSolution"
==> "Deploy"
RunTargetOrDefault "Deploy"