Index: trunk/tools/code-utils/clone-all.php |
— | — | @@ -3,9 +3,8 @@ |
4 | 4 | $gerrit = "gerrit.wikimedia.org"; |
5 | 5 | $baseUrl = "ssh://$gerrit:29418"; // "https://$gerrit/r/p" if you have no ssh access |
6 | 6 | |
7 | | -$skipRepositories = array( 'test/*', 'operations/*', 'analytics*' ); |
| 7 | +$skipRepositories = array( 'test/*', 'operations/*', 'analytics*', 'labs/*', 'integration/*' ); |
8 | 8 | |
9 | | - |
10 | 9 | $command = <<<EOF |
11 | 10 | wget https://$gerrit/r/gerrit/rpc/ProjectAdminService --post-data='{"jsonrpc":"2.0","method":"visibleProjects","params":[],"id":1}' --header "Content-Type: application/json; charset=utf-8" --header "Accept: application/json" -O - |
12 | 11 | EOF; |
— | — | @@ -23,24 +22,24 @@ |
24 | 23 | foreach ( $projects as $project ) { |
25 | 24 | $repo = $project->name->name; |
26 | 25 | print "$repo\n"; |
27 | | - |
| 26 | + |
28 | 27 | if ( strpos( $project->description, "DON'T USE" ) !== false ) { |
29 | 28 | echo " Don't use, skipped\n"; |
30 | 29 | continue; |
31 | 30 | } |
32 | | - |
| 31 | + |
33 | 32 | foreach ( $skipRepositories as $skip ) { |
34 | 33 | if ( fnmatch( $skip, $repo, FNM_CASEFOLD ) ) { |
35 | 34 | echo " Skipped\n"; |
36 | 35 | continue 2; |
37 | 36 | } |
38 | 37 | } |
39 | | - |
| 38 | + |
40 | 39 | if ( file_exists( "$repo/.git" ) ) { |
41 | 40 | echo " There's already a repository at $repo\n"; |
42 | 41 | continue; |
43 | 42 | } |
44 | | - |
| 43 | + |
45 | 44 | $start = microtime( true ); |
46 | 45 | passthru( "git clone " . escapeshellarg( "$baseUrl/$repo.git" ) . " " . escapeshellarg( $repo ), $exitCode ); |
47 | 46 | $end = microtime( true ); |