I'm trying to find a fine solution for migration control betweem local wamp and server lamp involving git and Drupal.
I've already found a nice solution for migration control with CodeIgniter thanks to the Migration class. Then I can utilize the post-receive
hook and just run php path/to/codeigniter/index.php migrate/index
and it simply updates the database design along with the files.
However from what I've seen so far with Drupal, this is a bit trickier. I am currently considering to in some manner store Drush commands for enabling new modules and such. The idea would then be to have a system similiar to Migration which I simply run with post-receive
and the new modules gets enabled through drush en -y new_module
whos command is saved somewhere.
The ideal flow illustrated here:
What I suppose I would need to complete this flow is to have the bash script executed by post-receive
, fetch some file named for instance 001.txt
inside a directoy named drush_commands
, and based on a variable I have saved in a file mentioned in .gitignore
, execute the files with a number higher then the saved value, then set the value to the highest number amongst the executed files.
Question
However I'm not sure how to and if it's even possible to do this with bash scripts ideally. Is this approach an ideal one and how would the bash script work, or do you know any better way to have the same modules enabled (and other drush things) on both my local wamp and the server upon push
ing?
Bonus question: Could I use this approach to handle changes to field data, content type and such? I have some trouble grasping exactly how I can sync the overall structure between local and live version.