Options

Database packaging and Powershell scripts

edited July 4, 2013 4:31AM in Deployment Manager
The new SSMS add-in with DM 2.0 allows me to generate a quick database pkg for a chosen database, but how am I to add in any powershell scripts? What am i missing?

Comments

  • Options
    Hi Jeff,

    What actions are you looking to perform with the PowerShell, over the built-in deployment logic? Do they need access to the extracted database scripts?

    If not, then you can package up some custom PowerShell using RgPublish, and add that as a step, that can be reused as needed.

    If they do need access to the database scripts, then this would need to be done using the sqlCI command line tool / build scripts, that are part of the automation pack we mentioned:
    http://www.red-gate.com/products/sql-de ... tion-pack/

    Using custom PowerShell that has access to the database scripts is not possible from the SSMS add-in yet. It's something on our list to address. How big of an issue is this for you?

    Thanks,

    Justin
    Justin Caldicott
    Developer
    Redgate Software Ltd
  • Options
    I won't need access to the sql scripts for database deployment. However, since database deployment is done first, I'd still need to do safety tasks like backing up some databases, turning off the application, and so on. What is the best way here? I was thinking I could create my own package with just powershell scripts to do the database backups, and turn off the app, call it "preliminaries" before any other step runs...

    I don't see a way to add my powershell to the database pkg. Not sure it would help.
  • Options
    James BJames B Posts: 1,124 Silver 4
    You could create a Deploy.ps1 in a folder of it's own that would perform any extra steps you need, use RGPublish to package that up, then add it to your release as a step before the database deployment step?
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.