Page MenuHomePhabricator
Paste P1698

Conduit script for mass repo creations
ActivePublic

Authored by WikiChad on Jan 8 2015, 3:18 PM.
#!/usr/bin/php
<?php
foreach( file( '/Users/chad/mw-repo-list' ) as $line ) {
list( $callsign, $oldname, $newname ) = explode( "\t", $line );
$newname = trim( $newname );
$prettyname = explode( '-', $newname, 2 );
$repoSpec = array(
'name' => $newname,
'vcs' => 'git',
'callsign' => $callsign,
"description" => "MediaWiki extension " . $prettyname[1],
"tracking" => true,
"uri" => "https://gerrit.wikimedia.org/r/p/$oldname",
"heraldEnabled" => false,
);
$repoSpec = json_encode( $repoSpec );
passthru( "echo '$repoSpec' | arc call-conduit repository.create" );
}

Event Timeline

WikiChad changed the title of this paste from untitled to Conduit script for mass repo creations.
WikiChad updated the paste's language from autodetect to php.