Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne committed May 27, 2019
1 parent d45bbc5 commit aeeb92b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Release.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Add-Type -assembly "system.io.compression.filesystem"
$source = "Release"
$destination = "ZKEACMS.Core.zip"
$destination = "ZKEACMS.zip"
Write-Host "Starting release" $destination
Write-Host "This may take a few minutes, please wait..."
if(Test-Path $source){
Expand All @@ -14,10 +14,14 @@ Set-Location src/ZKEACMS.WebHost
Invoke-Expression("publish-zkeacms")
Set-Location ../../
Write-Host "Copy files..."
Copy-Item -Path "src/ZKEACMS.WebHost/bin/Release/PublishOutput" -Destination "Release/Application" -Force -Recurse
New-Item -Path "." -Name "Release" -ItemType "directory" -Force
Move-Item -Path "src/ZKEACMS.WebHost/bin/Release/PublishOutput" -Destination "Release/Application"
New-Item -Path "Release/Application" -Name "App_Data" -ItemType "directory"
Copy-Item -Path "DataBase/SQLite/Database.sqlite" -Destination "Release/Application/App_Data/Database.sqlite" -Force
Copy-Item -Path "DataBase/SQLite/appsettings.json" -Destination "Release/Application/appsettings.json" -Force
$dbSource = 'DataBase'
$dbDestination = 'Release/Database'
$exclude = @('*.mdf','*.ldf')
$exclude = @('*.mdf','*.ldf','*.cmd','*.exe','*.dll','*.sh','*.json')
$length =(Get-Item -Path ".\" -Verbose).FullName.Length + $dbSource.Length + 1
Get-ChildItem $dbSource -Recurse -Exclude $exclude | Copy-Item -Destination {Join-Path $dbDestination $_.FullName.Substring($length)}
Write-Host "Archive to" $destination
Expand Down

0 comments on commit aeeb92b

Please sign in to comment.