我成功编写Nant
脚本以发布Database
的代码。
<project name="Local-Deploy" basedir="." default="publish_code">
<property name="MSBuildPath" value="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"/>
<property name="Solution_file_path" value="xxx.WebUI/xxxWebUI.csproj"/>
<property name="Published_path" value="C:\demo\Publish_code"/>
<target name="publish_code">
<exec program="${MSBuildPath}">
<arg line='"${Solution_file_path}"'/>
<arg line='/property:Configuration="TEST";DeployOnBuild=true;PublishProfile=Local-Deploy;_PackageTempDir=${Published_path}'/>
<arg value="/target:Build" />
</exec>
</target>
</project>
如何编写Nant
脚本以将代码发布到目标数据库连接应为xxx.amazonaws.com
,并且应使用带有用户名XXX
和密码xxx
的SQL Server身份验证。
请建议我。
谢谢你的进步。 :)
答案 0 :(得分:0)
根据:Using NAnt to deploy the database:
<target name="test">
<property name="test.script" value="${dir.sql}/test.sql"/>
<property name="test.connstring"
value="Provider=SQLOLEDB;Server=localhost;Database=nHello;User ID=nHelloUser;Password=showme"/>
<echo file="${test.script}" message="execute p_GetMessage;"/>
<echo message="* Connecting to ${test.connstring}"/>
<echo message="* Executing ${path::get-file-name(test.script)}"/>
<sql connstring="${test.connstring}" delimiter=";" delimstyle="Normal" source="${test.script}"/>
</target>