Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local building solutions #121

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions LocalPublish.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

# step one build the project

#remove the publish fodler

$sourcePath = ".\publish\*"
$destinationPath = ".\publish\build-artifacts.zip"
$publishPath = ".\publish"

if(Test-Path $publishPath) {
Write-Host "Cleaning publish path"
Remove-Item -Recurse $publishPath
}

Write-Host "Restoring nuget packages" -ForegroundColor Green
dotnet restore

Write-Host "Restoring tools" -ForegroundColor Green
dotnet tool restore

Write-Host "Building" -ForegroundColor Green
dotnet build --configuration Release --no-restore

Write-Host "Running unit tests" -ForegroundColor Green
dotnet test --configuration Release --no-build --verbosity normal

Write-Host "Publishing package" -ForegroundColor Green
dotnet publish --no-build --configuration Release --output $publishPath

Write-Host "Generting indempotent migration script" -ForegroundColor Green
dotnet ef migrations script --no-build --configuration Release --project src/Migrators/Migrators.MSSQL/Migrators.MSSQL.csproj --startup-project src/Server.UI/Server.UI.csproj --context Cfo.Cats.Infrastructure.Persistence.ApplicationDbContext --idempotent -o ./publish/Migration.sql

Write-Host "Compressing artifacts" -ForegroundColor Green
Compress-Archive -Path $sourcePath -DestinationPath $destinationPath

Write-Host "Cleaning publish folder" -ForegroundColor Green

Get-ChildItem -Path $publishPath -Exclude "build-artifacts.zip" | ForEach-Object {
if ($_.FullName -ne $destinationPath) {
Remove-Item -Recurse -Force $_.FullName
}
}
11 changes: 0 additions & 11 deletions build/Build.csproj

This file was deleted.

16 changes: 0 additions & 16 deletions build/BuildContext.cs

This file was deleted.

19 changes: 0 additions & 19 deletions build/BuildTask.cs

This file was deleted.

22 changes: 0 additions & 22 deletions build/CleanTask.cs

This file was deleted.

8 changes: 0 additions & 8 deletions build/Default.cs

This file was deleted.

13 changes: 0 additions & 13 deletions build/Program.cs

This file was deleted.

21 changes: 0 additions & 21 deletions build/PublishTask.cs

This file was deleted.

18 changes: 0 additions & 18 deletions build/RestoreTask.cs

This file was deleted.

20 changes: 0 additions & 20 deletions build/TestTask.cs

This file was deleted.

8 changes: 1 addition & 7 deletions cats.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Expand Down Expand Up @@ -27,8 +27,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\Build.csproj", "{7CC5B8A2-2122-4907-B970-FD7A3EEA1C4C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{62ABFE2F-D4F3-4E44-AA07-20D679B04CF3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Application.UnitTests", "test\Application.UnitTests\Application.UnitTests.csproj", "{2FC2E6B9-5186-4A39-A2CC-0975ED2AEC1E}"
Expand Down Expand Up @@ -61,10 +59,6 @@ Global
{A7B309FF-FFA9-4290-B982-46DA80D0E0DF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7B309FF-FFA9-4290-B982-46DA80D0E0DF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7B309FF-FFA9-4290-B982-46DA80D0E0DF}.Release|Any CPU.Build.0 = Release|Any CPU
{7CC5B8A2-2122-4907-B970-FD7A3EEA1C4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7CC5B8A2-2122-4907-B970-FD7A3EEA1C4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7CC5B8A2-2122-4907-B970-FD7A3EEA1C4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7CC5B8A2-2122-4907-B970-FD7A3EEA1C4C}.Release|Any CPU.Build.0 = Release|Any CPU
{2FC2E6B9-5186-4A39-A2CC-0975ED2AEC1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2FC2E6B9-5186-4A39-A2CC-0975ED2AEC1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FC2E6B9-5186-4A39-A2CC-0975ED2AEC1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Loading