Skip to content

Commit

Permalink
script to help prepare files for release in a consitent way
Browse files Browse the repository at this point in the history
  • Loading branch information
marcingminski committed Apr 1, 2021
1 parent 0ee49ea commit c674967
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions SQLWATCH-Build-Release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Create temp folder to store release files
# Copy dashboard files
# Copy dacpacs
# Copy executables

# Get root path of this script:
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition

# Read SQLWATCH build version:

[string]$Version = Select-String -Path "$PSScriptRoot\SqlWatch.Monitor\Project.SqlWatch.Database\Scripts\Pre-Deployment\SetDacVersion.sql" -Pattern [0-9] | select-object -ExpandProperty Line
[string]$Version = $Version.Trim()

# Create TMP folder to store release files:
$TmpFolder = "C:\TEMP\"
$ReleaseFolderName = "SQLWATCH $Version $(get-date -f yyyyMMddHHmmss)"
$ReleaseFolder = "$TmpFolder\$ReleaseFolderName"
New-Item -Path $ReleaseFolder -ItemType Directory

# Copy Dashboard files:
Copy-Item -Recurse -Path "$PSScriptRoot\SqlWatch.Dashboard\" -Destination "$ReleaseFolder" -Container -Exclude *.bak

# Copy Dacpacs:
Copy-Item -Path "$PSScriptRoot\SqlWatch.Monitor\Project.SqlWatch.Database\bin\Debug\*.dacpac" -Destination "$ReleaseFolder"

# Copy SSIS:
Copy-Item -Path "$PSScriptRoot\SqlWatch.Monitor\Project.SqlWatch.IntegrationServices\bin\Development\SQLWATCHSSIS.ispac" -Destination "$ReleaseFolder"

# Copy SQLWATCH Importer
New-Item -Path "$ReleaseFolder\SqlWatchImport" -ItemType Directory
Copy-Item -Path "$PSScriptRoot\SqlWatch.Monitor\Project.SqlWatchImport\bin\Debug\*" -Destination "$ReleaseFolder\SqlWatchImport" -Exclude *.log,*.pdb

# Create ZIP:
Compress-Archive -Path $ReleaseFolder -DestinationPath "$TmpFolder\$ReleaseFolderName.zip"

0 comments on commit c674967

Please sign in to comment.