I created a drush extension called create-new site.
The extention was originally created to set the hosts and vhosts files using drush.
Afterwards i added other features, so now what my extension can do is as follows:
Create a new folder in the web root (or suply a already existing folder)
Add information to the hosts and vhosts files
Create a new (empty) database
Checkout a svn repository
Restart the (apache) server
A command for creating multisites was added as well, this does stuff a bit different
Create a new folder in the sites folder
copy default.settings.php to settings.php inside this new folder
Add information to the hosts and vhosts files
Create a new (empty) database
Restart the (apache) server
So now what i do to start off a new web project:
drush cns my-site --newdb=mysite_db
After that i can visit http://my-site, and a new db is ready to be used.
When i check out my install profile from svn this is what happens:
drush cns my-site --newdb=mysqite_db --svn=install-profile
So now when i visit http://my-site, i immediately get my install pages.
A new db was created as well, so i can fill in that information and i am ready to go.
The settings for this command are in a separate settings file. Information such as db login, svn login, location of host files etc... are set there.
These settings can be overridden in the drush command as well.
This little drush extension saves me a fair amount of time.
So if anyone is interested, i'm willing to share...
Comments
Comment #1
_rohn commentedWow! That sounds like quite a tedium saver!! If you wouldn't mind sharing more I'd be very interested - I'm still new to Drupal, but already finding myself creating multiple sites on multiple boxes over and over, a tool that would do all that you say would certainly save time, sanity, and errors (gotta save up those errors for a rainy day).
_rohn
Comment #2
greg.1.anderson commentedThis is done already in provision and drubuntu; I have bash scripts to do something similar (https://github.com/greg-1-anderson/utiliscripts). I don't think I'll take this command in drush_extras.
Comment #3
greg.1.anderson commentedIf anyone wants to create vhost files via a drush command, see: http://groups.drupal.org/node/155849.