Nov
13
(2006)
Provisionator on Drupal CVS
Filed under: Uncategorized. Tags: drupal, module, provisionator.
I've just moved the Provisionator module onto Drupal.org's CVS server. The current version of the module is far from complete, but it does function. Specifically, it does:
- create database for new site
- populate database with selected mysqldump template file
- copy template site directory (with settings.php, files, modules, themes)
- modify settings.php as needed
- create symlink to expose Drupal via Apache for the new site (as a subdirectory of a server, currently)
- add a new record to the database, describing the site
- list all records in the Provisionator database table
It's got a lot of room for improvement, and more than likely needs some tightening down for security and Doing It The Right Way, but it works. It also currently assumes MySQL, and a very specific shared hosting pattern where Drupal isn't in wwwroot itself, but is exposed by adding multiple symlinks within the wwwroot directory.
I'm having difficulty creating the actual Project on Drupal.org - I get an Access Denied error. So, until that's resolved, it's available via CVS at least. Once the Project is created, there will be an issue tracker, etc…
Oh, and don't laugh too hard at the code. I know most/all of it could be done cleaner/better/faster, but I'm cobbling it together as I learn. Also, I'll be working on better documentation so others can use the module or contribute code.
PS. Man, does CVS suck! I’ve been using SVN for source code management for over a year. Feels like being dropped back in MS-DOS or something now that I’m using CVS again. Ick. Hopefully, Drupal.org will migrate to SVN sometime soon?
Update: The permissions issue on my Drupal.org account has been cleared up, so Provisionator.module is now on the air!
Comments
6 Responses to “Provisionator on Drupal CVS”

Not to fork your blog-thread too hard, but that specifically about CVS do you dislike? If you can enumerate your points a transition would be more likely to happen sooner than later.
I like SVN as well, but Drupal won’t be moving to SVN until there is an svn module which contains the same functionality as the cvs.module - note that there are at least two svn modules available now: http://drupal.org/project/subversion and http://drupal.org/project/svn but I don’t believe either really strives to be the cvs replacement for project.
So you would install provisionator as a module in one of the sites, right?
Wouldn’t it make sense to have it completely outside of Drupal? Security wise your solution is a bit scary to me.
greggles - CVS just needs more feeding. In SVN, you can add an entire directory of folders and files with a single svn add, while with CVS, you have to manually add every directory and file separately. Painful. Took me 4 commits to get everything properly into Drupal CVS. That’s just one gripe
Mariuss - yeah. You’d set up a “master” site, enabling Provisionator for it, and use it as a deployment control panel from there. It started life as a separate application, but it felt out of place that way. Security would totally be an issue, if “access provisionator” privilege was granted too freely. For added security, the Provisionator module could be installed only for a single site in it’s own site/sitename/modules directory. Then, people couldn’t use it on their own provisioned drupal sites… Actually, that’s how it should be done, or in a separate installation of Drupal.
D’Arcy,
I saw this come through drupal.org earlier today — I’m looking forward to testing this out — thanks for sharing this back!
D’Arcy - my main concern with regards to security is that you have to make the sites folder world writable. Right?
I suppose you do, but you’d have to do that with the Drupal 5 installer as well, and similar things while installing MediaWiki, Moodle, etc… It doesn’t have to be _world_ writable, just writable by www (which is effectively the same thing, though…)