Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Scripts One Time When Deployed

We're currently using Phing for deployment and use dbdeploy to apply any database changes. However, there are occasionally changes we'd like to make during deployment that are better handled by our object model and therefore we write one time use PHP scripts that we're running manually after deployment.

Are there any existing solutions similar to dbdeploy that will handle running scripts and, more importantly, tracking which ones have run so that each script only runs once?

like image 501
Jonathan Campbell Avatar asked Nov 26 '22 11:11

Jonathan Campbell


1 Answers

I think this could be potentially useful for others too. If you can't think of other solution I think the best one will be to have a look at the file that implements the DBDeploy task, copy it into a custom task, reuse the database checking functionality but instead of producing SQL scripts execute the scripts you need.

If you're happy with it you might also consider contributing it to Phing. I'm sure they will be happy to include it (see Phing-How To Contribute).

like image 73
poisson Avatar answered Nov 27 '22 23:11

poisson