forked from alexbeletsky/trackyt.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresetdb.bat
33 lines (24 loc) · 928 Bytes
/
resetdb.bat
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
@echo off
if '%1' == '' goto usage
SET DIR=%~d0%~p0%
SET database.name="%1"
SET sql.files.directory="%DIR%\db"
SET server.database=".\SQLEXPRESS"
SET version.file="build_output\_BuildInfo.xml"
SET repository.path="git://github.com/alexanderbeletsky/trackyt.net"
SET version.xpath="//buildInfo/version"
SET environment=LOCAL
"%DIR%deployment\rh\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% --ni --drop
if %ERRORLEVEL% NEQ 0 goto errors
"%DIR%deployment\rh\rh.exe" /d=%database.name% /f=%sql.files.directory% /s=%server.database% /vf=%version.file% /vx=%version.xpath% /r=%repository.path% /env=%environment% --ni --simple
if %ERRORLEVEL% NEQ 0 goto errors
goto finish
:usage
echo.
echo Usage: initdb.bat [database]
echo [database] - name of database to update
echo.
EXIT /B 1
:errors
EXIT /B %ERRORLEVEL%
:finish