Skip to content
Permalink
Browse files
Use the Aegir team's offsite git repos instead of the old, crufty data
in CVS that they abandoned long ago.
  • Loading branch information
sdboyer committed Feb 20, 2011
1 parent 22a0fd4 commit 4c410d7c7e7f1c20b8586bf8441d24bec8bb6882
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
@@ -56,14 +56,26 @@
// ensure vc_project's table is empty for a nice, clean insert
db_delete('versioncontrol_project_projects')->execute();


// A set of repos to assemble via cloning instead
$cloners = array(
851266 => 'git://github.com/sdboyer/drupalorg-git.git', // tggm, woot!
196005 => 'git://git.aegirproject.org/provision.git', // aegir, provision
195997 => 'git://git.aegirproject.org/hostmaster.git', // aegir, hostmaster
);

$git_basedir = variable_get('drupalorg_git_basedir', '/var/git');
$templatedir = "$git_basedir/templates/built/project";

$repos = array();
foreach ($projects as $project) {
if (empty($project->nid)) {
git_log('Project has no nid. This should NOT happen.', 'WARN', $project->uri);
continue;
}

if (!is_dir('/var/git/repositories/project/' . $project->uri . '.git') && empty($empties[$project->nid])) {

if (!is_dir('/var/git/repositories/project/' . $project->uri . '.git') && empty($empties[$project->nid]) && empty($cloners[$project->nid])) {
git_log(strtr('Project has a CVS path listed, but no code was migrated into a git repository at the expected target location, !location.', array('!project' => $project->uri, '!location' => 'project/' . $project->uri . '.git')), 'WARN', $project->uri);
continue;
}
@@ -94,18 +106,14 @@
->condition('c.nid', $project->nid)
->execute();

if ($project->nid == 851266) {
// Hehehe...do a special case for tggm, just to be showy :)
$git_basedir = variable_get('drupalorg_git_basedir', '/var/git');
$templatedir = "$git_basedir/templates/built/project";
if (isset($cloners[$project->nid])) {
$tgt_dir = "$git_basedir/repositories/project/$project->uri.git";

$job = array(
'repository' => $repo,
'operation' => array(
// Clone the migration repo from github and set the launch branch as default. woot!
'passthru' => array(
'clone -b launch --bare --template ' . $templatedir . ' git://github.com/sdboyer/drupalorg-git.git ' . $tgt_dir,
"clone --bare --template $templatedir {$cloners[$project->nid]} $tgt_dir",
),
),
);
@@ -25,4 +25,14 @@
function _tggm_exception_sandbox($row) {
// The 'sandbox' catchall project would cause us to import ALL sandboxes. No freakin way.
return FALSE;
}

function _tggm_exception_hostmaster($row) {
// hostmaster is being cloned in instead
return FALSE;
}

function _tggm_exception_provision($row) {
// provision is being cloned in instead
return FALSE;
}

0 comments on commit 4c410d7

Please sign in to comment.