I am trying to use TeamCity to automate the publish of my database project after it builds.
I am using the MSBuild runner with "Publish" targets
My SQL project contains a publish profile file "Test.publish.xml"
I used this MSBuild parameter to tell MSBuild which publish profile file to use:
/p:SqlPublishProfilePath=Test.publish.xml
The output path of the project has been modified, so instead of the default "bin\Output" it is "sql\Staging"
When the build step executes I get the error:
[12:19:11]Step 3/3: Publish (MSBuild) (5s)
[12:19:15][Step 3/3] Alpha\Alpha.sqlproj.teamcity: Build target: Publish
[12:19:15][Alpha\Alpha.sqlproj.teamcity] SqlPublish
[12:19:15][SqlPublish] SqlPublishTask
[12:19:15][SqlPublishTask] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(1717, 5): File "D:\BuildAgent\work\8c364da49a1f90ba\Alpha\bin\Output\Alpha.sqlproj.dacpac" does not exist.
[12:19:16][Step 3/3] Step Publish (MSBuild) failed
So, as you can see, it is looking for the .dacpac file in the standard bin\Output directory instead of the modified output directory path. Also, it is expecting the dacpac file to be called Alpha.sqlproj.dacpac, but my dacpac file is called Alpha.dacpac
What I need to do somehow is tell MSBuild where to find the dacpac file, because it is not taking any notice of the custom build output directory. Is there another MSBuild parameter or something that I can add to my publish profile file?
I know I could use sqlpackage.exe as an easy alternative, but it does not seem to be on the machine (at C:\Program Files\Microsoft SQL Server\110\DAC\bin), despite SQL Server Data Tools being installed and that is another battle I am working on...