forked from Informatievlaanderen/postal-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
executable file
·134 lines (107 loc) · 4.22 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#r "paket:
version 7.0.2
framework: net6.0
source https://api.nuget.org/v3/index.json
nuget Be.Vlaanderen.Basisregisters.Build.Pipeline 6.0.4 //"
#load "packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/build-generic.fsx"
open Fake.Core
open Fake.Core.TargetOperators
open Fake.IO.FileSystemOperators
open ``Build-generic``
let product = "Basisregisters Vlaanderen"
let copyright = "Copyright (c) Vlaamse overheid"
let company = "Vlaamse overheid"
let dockerRepository = "postal-registry"
let assemblyVersionNumber = (sprintf "2.%s")
let nugetVersionNumber = (sprintf "%s")
let buildSolution = buildSolution assemblyVersionNumber
let buildSource = build assemblyVersionNumber
let buildTest = buildTest assemblyVersionNumber
let setVersions = (setSolutionVersions assemblyVersionNumber product copyright company)
let test = testSolution
let publishSource = publish assemblyVersionNumber
let pack = pack nugetVersionNumber
let containerize = containerize dockerRepository
let push = push dockerRepository
supportedRuntimeIdentifiers <- [ "msil"; "linux-x64" ]
// Solution -----------------------------------------------------------------------
Target.create "Restore_Solution" (fun _ -> restore "PostalRegistry")
Target.create "Build_Solution" (fun _ ->
setVersions "SolutionInfo.cs"
buildSolution "PostalRegistry")
Target.create "Test_Solution" (fun _ -> test "PostalRegistry")
Target.create "Publish_Solution" (fun _ ->
[
"PostalRegistry.Projector"
"PostalRegistry.Api.Legacy"
"PostalRegistry.Api.Oslo"
"PostalRegistry.Api.Extract"
"PostalRegistry.Api.CrabImport"
"PostalRegistry.Projections.Legacy"
"PostalRegistry.Projections.Extract"
"PostalRegistry.Projections.LastChangedList"
"PostalRegistry.Projections.Syndication"
] |> List.iter publishSource)
Target.create "Pack_Solution" (fun _ ->
[
"PostalRegistry.Projector"
"PostalRegistry.Api.Legacy"
"PostalRegistry.Api.Oslo"
"PostalRegistry.Api.Extract"
"PostalRegistry.Api.CrabImport"
] |> List.iter pack)
Target.create "Containerize_Projector" (fun _ -> containerize "PostalRegistry.Projector" "projector")
Target.create "PushContainer_Projector" (fun _ -> push "projector")
Target.create "Containerize_ApiLegacy" (fun _ -> containerize "PostalRegistry.Api.Legacy" "api-legacy")
Target.create "PushContainer_ApiLegacy" (fun _ -> push "api-legacy")
Target.create "Containerize_ApiOslo" (fun _ -> containerize "PostalRegistry.Api.Oslo" "api-oslo")
Target.create "PushContainer_ApiOslo" (fun _ -> push "api-oslo")
Target.create "Containerize_ApiExtract" (fun _ -> containerize "PostalRegistry.Api.Extract" "api-extract")
Target.create "PushContainer_ApiExtract" (fun _ -> push "api-extract")
Target.create "Containerize_ApiCrabImport" (fun _ -> containerize "PostalRegistry.Api.CrabImport" "api-crab-import")
Target.create "PushContainer_ApiCrabImport" (fun _ -> push "api-crab-import")
Target.create "Containerize_ProjectionsSyndication" (fun _ -> containerize "PostalRegistry.Projections.Syndication" "projections-syndication")
Target.create "PushContainer_ProjectionsSyndication" (fun _ -> push "projections-syndication")
// --------------------------------------------------------------------------------
Target.create "Build" ignore
Target.create "Test" ignore
Target.create "Publish" ignore
Target.create "Pack" ignore
Target.create "Containerize" ignore
Target.create "Push" ignore
"NpmInstall"
==> "DotNetCli"
==> "Clean"
==> "Restore_Solution"
==> "Build_Solution"
==> "Build"
"Build"
==> "Test_Solution"
==> "Test"
"Test"
==> "Publish_Solution"
==> "Publish"
"Publish"
==> "Pack_Solution"
==> "Pack"
"Pack"
==> "Containerize_Projector"
==> "Containerize_ApiLegacy"
==> "Containerize_ApiOslo"
==> "Containerize_ApiExtract"
==> "Containerize_ApiCrabImport"
==> "Containerize_ProjectionsSyndication"
==> "Containerize"
// Possibly add more projects to containerize here
"Containerize"
==> "DockerLogin"
==> "PushContainer_Projector"
==> "PushContainer_ApiLegacy"
==> "PushContainer_ApiOslo"
==> "PushContainer_ApiExtract"
==> "PushContainer_ApiCrabImport"
==> "PushContainer_ProjectionsSyndication"
==> "Push"
// Possibly add more projects to push here
// By default we build & test
Target.runOrDefault "Test"