コード例 #1
0
 public function process()
 {
     $dump_is_done = $this->gitolite_driver->updateMirror($this->getMirrorIdFromParameters(), $this->getMirrorOldHostnameFromParameters());
     if ($dump_is_done) {
         $this->done();
         return true;
     }
     $this->error("Something went wrong while updating mirror");
 }
 public function process()
 {
     $dump_is_done = $this->gitolite_driver->dumpAllMirroredRepositories();
     if ($dump_is_done) {
         $this->done();
         return true;
     }
     $this->error('Something went wrong while dumping gitolite configuration.');
 }
コード例 #3
0
 public function process()
 {
     foreach ($this->getProjectIdsFromParameters() as $project_id) {
         $project = $this->project_manager->getProject($project_id);
         if ($project && !$project->isError()) {
             $this->logger->debug('Update configuration for project ' . $project->getID());
             $this->gitolite_driver->dumpProjectRepoConf($project);
         }
     }
     $this->system_event_manager->queueGrokMirrorGitoliteAdminUpdate();
     $this->done();
 }
コード例 #4
0
 public function itAddsAllTheRequiredFilesForPush()
 {
     $hostname = "master";
     stub($this->gitoliterc_reader)->getHostname()->returns($hostname);
     touch($this->_glAdmDir . '/conf/projects/project1.conf');
     expect($this->another_git_exec)->add()->count(2);
     expect($this->another_git_exec)->add('conf/gitolite.conf')->at(0);
     expect($this->another_git_exec)->add('conf/master.conf')->at(1);
     $this->another_gitolite_driver->updateMainConfIncludes();
 }
コード例 #5
0
 /**
  * Rename a project
  *
  * @param Project $project The project to rename
  * @param string  $newName The new name of the project
  *
  * @return true if success, false otherwise
  */
 public function renameProject(Project $project, $newName)
 {
     if (is_dir($this->driver->getRepositoriesPath() . '/' . $project->getUnixName())) {
         $backend = $this->getBackend();
         $ok = rename($this->driver->getRepositoriesPath() . '/' . $project->getUnixName(), $this->driver->getRepositoriesPath() . '/' . $newName);
         if ($ok) {
             try {
                 $this->glRenameProject($project->getUnixName(), $newName);
             } catch (Exception $e) {
                 $backend->log($e->getMessage(), Backend::LOG_ERROR);
                 return false;
             }
         } else {
             $backend->log("Rename: Unable to rename gitolite top directory", Backend::LOG_ERROR);
         }
     }
     return true;
 }
コード例 #6
0
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Rename project in gitolite configuration
 */
require_once 'pre.php';
require_once dirname(__FILE__) . '/../include/Git_GitoliteDriver.class.php';
require_once dirname(__FILE__) . '/../include/GitRepositoryUrlManager.class.php';
if ($argc !== 3) {
    echo "Usage: " . $argv[0] . " oldname newname" . PHP_EOL;
    exit(1);
}
/* @var $git_plugin GitPlugin */
$git_plugin = PluginManager::instance()->getPluginByName('git');
$url_manager = new Git_GitRepositoryUrlManager($git_plugin);
$driver = new Git_GitoliteDriver($git_plugin->getLogger(), $git_plugin->getGitSystemEventManager(), $url_manager);
if ($driver->renameProject($argv[1], $argv[2])) {
    echo "Rename done!\n";
    exit(0);
} else {
    echo "*** ERROR: Fail to rename project " . $argv[1] . " into " . $argv[2] . " gitolite repositories" . PHP_EOL;
    exit(1);
}
コード例 #7
0
/**
 * Copyright (c) Enalean, 2011. All Rights Reserved.
 *
 * This file is a part of Tuleap.
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Rename project in gitolite configuration
 */
require_once 'pre.php';
require_once dirname(__FILE__) . '/../include/Git_GitoliteDriver.class.php';
$driver = new Git_GitoliteDriver();
if ($driver->dumpSSHKeys()) {
    echo "Rename done!\n";
    exit(0);
} else {
    echo "*** ERROR: Fail to dump ssh keys" . PHP_EOL;
    exit(1);
}
コード例 #8
0
 public function process()
 {
     $this->gitolite->checkAuthorizedKeys();
     $this->gitgc->cleanUpGitoliteAdminWorkingCopy();
     $this->system_event_manager->queueGrokMirrorManifestCheck();
 }
コード例 #9
0
ファイル: gl-dump-sshkeys.php プロジェクト: nterray/tuleap
 *
 * Tuleap is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Tuleap is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Tuleap; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Rename project in gitolite configuration
 */
require_once 'pre.php';
require_once dirname(__FILE__) . '/../include/Git_GitoliteDriver.class.php';
$user = null;
if (isset($argv[1])) {
    $user = UserManager::instance()->getUserById($argv[1]);
}
$driver = new Git_GitoliteDriver();
if ($driver->dumpSSHKeys($user)) {
    echo "SSH Keys dump done!\n";
    exit(0);
} else {
    echo "*** ERROR: Fail to dump ssh keys" . PHP_EOL;
    exit(1);
}
コード例 #10
0
 /**
  * Called by hook when SSH keys of users are modified.
  *
  * @param array $params
  */
 public function edit_ssh_keys($params)
 {
     require_once 'Git_GitoliteDriver.class.php';
     $user = UserManager::instance()->getUserById($params['user_id']);
     if ($user) {
         $gitolite = new Git_GitoliteDriver();
         if (is_dir($gitolite->getAdminPath())) {
             $gitolite->initUserKeys($user);
             $gitolite->push();
         }
     }
 }
コード例 #11
0
 public function itIsNotInitializedldIfThereIsNoValidDirectory()
 {
     $driver = new Git_GitoliteDriver($this->_glAdmDir);
     $this->assertFalse($driver->isInitialized($this->_fixDir));
 }