-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeployPublish.bat
More file actions
67 lines (59 loc) · 1.8 KB
/
DeployPublish.bat
File metadata and controls
67 lines (59 loc) · 1.8 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
REM DeployPublish.bat - Publishes the application to the .\publish folder
REM Usage: Run this script from the project root directory
echo ========================================
echo SQLTriage Deploy Script
echo ========================================
echo.
REM Step 0: Clean publish folder
echo [0/4] Cleaning publish folder...
if exist "publish" rmdir /S /Q "publish"
mkdir publish
echo.
REM Step 1: Deploy SQLWATCH database
echo [1/4] Deploying SQLWATCH database...
sqlcmd -S . -E -i "SQLWATCH_db\01_CreateSQLWATCHDB.sql"
if errorlevel 1 (
echo ERROR: SQLWATCH database creation failed!
exit /b 1
)
sqlcmd -S . -E -d SQLWATCH -i "SQLWATCH_db\02_PostSQLWATCHDBcreate.sql"
if errorlevel 1 (
echo ERROR: SQLWATCH post-creation scripts failed!
exit /b 1
)
echo SQLWATCH database deployed successfully.
echo.
REM Step 2: Restore and publish the application
echo [2/4] Restoring and publishing application...
dotnet restore SQLTriage.csproj -r win-x64
if errorlevel 1 (
echo ERROR: Restore failed!
exit /b 1
)
dotnet publish SQLTriage.csproj -c Release -r win-x64 --self-contained true -o ./publish
if errorlevel 1 (
echo ERROR: Publish failed!
exit /b 1
)
echo.
REM Step 3: Verify deployment
echo [3/4] Verifying SQLWATCH deployment...
sqlcmd -S . -E -d SQLWATCH -Q "SELECT COUNT(*) FROM sys.tables WHERE name LIKE 'sqlwatch%%'" -h -1
if errorlevel 1 (
echo WARNING: Could not verify SQLWATCH tables
)
echo.
echo ========================================
echo Deployment complete!
echo Database: SQLWATCH deployed
echo Output location: .\publish
echo ========================================
echo.
echo To run the application:
echo cd publish
echo SQLTriage.exe
echo.
REM Optional: List the final structure
echo Final publish folder structure:
tree /F publish 2>nul || dir /B publish