This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.ps1
47 lines (37 loc) · 1.43 KB
/
deploy.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
36
37
38
39
40
41
42
43
44
45
46
47
param($target="default")
. .\build-helpers
help {
write-help "deploy" "updates databases instead of rebuilding them."
}
function publish($project) {
task "Publish $project" {
dotnet publish --configuration $configuration --no-restore --output $publish/$project /nologo
} src/$project
}
main {
validate-target "default"
$targetFramework = "netcoreapp3.1"
$configuration = 'Release'
$product = "Totem"
$yearInitiated = (Get-Date).Year
$owner = "Headspring"
$publish = "$(resolve-path .)/publish"
$connectionStrings = @{
DEV = connection-string EmployeeDirectory src/Totem/appsettings.json;
}
task ".NET Environment" { dotnet --info }
task "Clean" { dotnet clean --configuration $configuration /nologo } src
task "Restore (Database Migration)" { dotnet restore --packages ./packages/ } src/Totem.DatabaseMigration
task "Restore (Solution)" { dotnet restore } src
task "Switch directory for NPM install" {Set-Location .\src\Totem }
task "Npm clean install" {
Remove-Item node_modules -Recurse -ErrorAction Ignore
npm install
}
task "Switch directlry back to root" {Set-Location ..\.. }
task "Build" { dotnet build --configuration $configuration --no-restore /nologo } src
task "Update DEV Databases" { update-database DEV } src/Totem.DatabaseMigration
delete-directory $publish
publish Totem
publish Totem.DatabaseMigration
}