Run scripts once during deployment

We are currently using Phing for deployment and are using dbdeploy to apply any database changes. However, during deployment, we want to make changes that are better handled by our object model, and therefore we write one-time PHP scripts that we run manually after deployment.

Are there existing solutions like dbdeploy that will process running scripts and, more importantly, keep track of which ones are executed so that each script is executed only once?

+4
source share
3 answers

I think this may be useful for others. If you can’t think of another solution, I think it’s best to look at the file that implements the DBDeploy task , copy it to the user task, reuse the database validation functions, but instead of creating the SQL scripts, run the scripts you need .

If you are happy with this, you can also consider contributing to Phing. I am sure they will be happy to include it (see Phing-How To Contribute ).

+1
source

What about:

  • Putting your scripts in a folder.
  • Quoting through a folder and running scripts.
  • Delete / move script files after execution.

Sounds like a hack, but it makes the imo way easier.

0
source

Probably the easiest I can imagine will use Phing ExecTask , also see the Phing User Guide (Stable) .

-1
source

All Articles