Deploying SQL (SSDT) projects to SQL 2012 from TFS 2012 Visual Studio 2012 using the TFS build controller. All projects have successfully deployed and pushed Post Deploy scripts to the server. (this is a test server where we are testing the deployment of a migration from 2008 to 2012). I needed to recreate the job (which is in the post deployment script) so I asked the deployment manager to drop the job and re-run the deploy. The post deployment script did not run and was not included in the generated deployment sql on the TFS server.
-
Not sure what you're talking about when you talk about jobs and deployment managers. I deploy SSDT projects using SqlPackage.exe and DACPAC'sDylan Smith– Dylan Smith2014-03-26 19:53:18 +00:00Commented Mar 26, 2014 at 19:53
-
I have my environment set up so dev sql projects are on continuous deployment to the dev server and when I am ready to deploy to QA or DEV I deploy using the build manager on the TFS server.William Salzman– William Salzman2014-03-27 20:40:19 +00:00Commented Mar 27, 2014 at 20:40
-
Can you look inside the dacpac file generated to verify that it has a postdeploy sql file and that it's correctly populated? I don't recall seeing the post-deploy scripts not running nor an option to prevent that.Peter Schott– Peter Schott2014-03-27 21:16:58 +00:00Commented Mar 27, 2014 at 21:16
-
The dacpac file for that project has a Model.sql but not a PostDeply.sql -- however the source for that project has a script that is marked as Post Deployment. Other project's dacpac files contain both sql files.William Salzman– William Salzman2014-03-28 17:02:42 +00:00Commented Mar 28, 2014 at 17:02
-
I did see the related question that you helped with (stackoverflow.com/q/16981612/236348) and as a precaution did remove all comments from that script, but it still does not include the script in my deployment, or the DACPAC that is generated.William Salzman– William Salzman2014-03-28 17:21:30 +00:00Commented Mar 28, 2014 at 17:21
|
Show 4 more comments
1 Answer
database Project not running Post Deployment scripts
See the linked question for the answer. I removed comments. When I did this the Build Action reverted to "None" I checked later and fixed this by setting to "Post-Deploy" and without the comments, it worked.