forked from serilog-contrib/serilog-sinks-elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.ps1
35 lines (28 loc) · 847 Bytes
/
Build.ps1
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
echo "In directory: $PSScriptRoot"
$solution = "serilog-sinks-elasticsearch.sln"
$test = "test\\Serilog.Sinks.Elasticsearch.Tests\\Serilog.Sinks.Elasticsearch.Tests.csproj"
$projectFolder = "src\\Serilog.Sinks.Elasticsearch"
$project = $projectFolder + "\\Serilog.Sinks.Elasticsearch.csproj"
function Invoke-Build()
{
Write-Output "Building"
if(Test-Path .\artifacts) {
echo "build: Cleaning .\artifacts"
Remove-Item .\artifacts -Force -Recurse
}
& dotnet test $test -c Release
if($LASTEXITCODE -ne 0)
{
Write-Output "The tests failed"
exit 1
}
& dotnet pack $project -c Release -o ..\..\artifacts
if($LASTEXITCODE -ne 0)
{
Write-Output "Packing the sink failed"
exit 1
}
Write-Output "Building done"
}
$ErrorActionPreference = "Stop"
Invoke-Build