-
Notifications
You must be signed in to change notification settings - Fork 14
/
deploy-package.bat
34 lines (22 loc) · 1.02 KB
/
deploy-package.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
:: Need to install - https://msdn.microsoft.com/en-us/library/mt204009.aspx
:: DacFx
SETLOCAL ENABLEEXTENSIONS
:: root is the folder containing this script (without trailing backslash)
set root=%~dp0
set root=%root:~0,-1%
::Path to the SqlPackage.exe
SET toolPath="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\SqlPackage.exe"
::Path to the dacpac
SET sourcePath=".\Voyage.Database\bin\Debug\Voyage.Database.dacpac"
::Connection string for the target
SET connectionString="Integrated Security=SSPI;Persist Security Info=False;Data Source=localhost;Initial Catalog=Voyage"
:: process command line
if not [%1]==[] if not [%1]==[-] set toolPath=%1
if not [%2]==[] if not [%2]==[-] set sourcePath=%2
if not [%3]==[] if not [%3]==[-] set connectionString=%3
:: report configuration
echo connectionString: %connectionString%
echo sourcePath: %sourcePath%
echo toolPath: %toolPath%
%toolPath% /TargetConnectionString:%connectionString% /SourceFile:%sourcePath% /Action:Publish