forked from Informatievlaanderen/parcel-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
147 lines (120 loc) · 4.63 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
135
136
137
138
139
140
141
142
143
144
145
146
147
#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.3 //"
#load "packages/Be.Vlaanderen.Basisregisters.Build.Pipeline/Content/build-generic.fsx"
open Fake
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 = "parcel-registry"
let assemblyVersionNumber = (sprintf "2.%s")
let nugetVersionNumber = (sprintf "%s")
let buildSource = build assemblyVersionNumber
let buildTest = buildTest assemblyVersionNumber
let setVersions = (setSolutionVersions assemblyVersionNumber product copyright company)
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 "ParcelRegistry")
Target.create "Build_Solution" (fun _ ->
setVersions "SolutionInfo.cs"
buildSource "ParcelRegistry.Projector"
buildSource "ParcelRegistry.Api.Legacy"
buildSource "ParcelRegistry.Api.Oslo"
buildSource "ParcelRegistry.Api.Extract"
buildSource "ParcelRegistry.Api.CrabImport"
buildSource "ParcelRegistry.Projections.Legacy"
buildSource "ParcelRegistry.Projections.Extract"
buildSource "ParcelRegistry.Projections.LastChangedList"
buildSource "ParcelRegistry.Projections.Syndication"
buildTest "ParcelRegistry.Tests"
)
Target.create "Test_Solution" (fun _ ->
[
"test" @@ "ParcelRegistry.Tests"
] |> List.iter testWithDotNet
)
Target.create "Publish_Solution" (fun _ ->
[
"ParcelRegistry.Projector"
"ParcelRegistry.Api.Legacy"
"ParcelRegistry.Api.Oslo"
"ParcelRegistry.Api.Extract"
"ParcelRegistry.Api.CrabImport"
"ParcelRegistry.Projections.Legacy"
"ParcelRegistry.Projections.Extract"
"ParcelRegistry.Projections.LastChangedList"
"ParcelRegistry.Projections.Syndication"
] |> List.iter publishSource)
Target.create "Pack_Solution" (fun _ ->
[
"ParcelRegistry.Projector"
"ParcelRegistry.Api.Legacy"
"ParcelRegistry.Api.Oslo"
"ParcelRegistry.Api.Extract"
"ParcelRegistry.Api.CrabImport"
] |> List.iter pack)
Target.create "Containerize_Projector" (fun _ -> containerize "ParcelRegistry.Projector" "projector")
Target.create "PushContainer_Projector" (fun _ -> push "projector")
Target.create "Containerize_ApiLegacy" (fun _ -> containerize "ParcelRegistry.Api.Legacy" "api-legacy")
Target.create "PushContainer_ApiLegacy" (fun _ -> push "api-legacy")
Target.create "Containerize_ApiOslo" (fun _ -> containerize "ParcelRegistry.Api.Oslo" "api-oslo")
Target.create "PushContainer_ApiOslo" (fun _ -> push "api-oslo")
Target.create "Containerize_ApiExtract" (fun _ -> containerize "ParcelRegistry.Api.Extract" "api-extract")
Target.create "PushContainer_ApiExtract" (fun _ -> push "api-extract")
Target.create "Containerize_ApiCrabImport" (fun _ -> containerize "ParcelRegistry.Api.CrabImport" "api-crab-import")
Target.create "PushContainer_ApiCrabImport" (fun _ -> push "api-crab-import")
Target.create "Containerize_ProjectionsSyndication" (fun _ -> containerize "ParcelRegistry.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"