Exemplo n.º 1
0
 /**
  * Create the basic structure folder for deploy with releases
  * @return string the output of remote commands executed
  */
 public function bootstrap()
 {
     $this->log("Boostrapping environment ...");
     $bootstrapFolder = $this->releasesFolder . 'bootstrap';
     $this->idx->remote("mkdir -p " . $bootstrapFolder);
     $out = $this->sshClient->getLastOutput();
     $this->idx->remote("cd " . $this->remoteBaseFolder . " && ln -s releases/bootstrap current");
     $out .= $this->sshClient->getLastOutput();
     $this->log("Creating shared folders...");
     foreach ($this->sharedFolders as $folder) {
         $this->log("Creating shared folder " . $folder . " ...");
         $this->idx->remote('mkdir -p ' . $this->remoteBaseFolder . 'shared/' . $folder);
     }
     return $out;
 }
Exemplo n.º 2
0
    $env = $idx->getCurrentTargetName();
    if (!$go) {
        echo "\nDry Run\n";
    }
    $idx->setDryRun(!$go);
    $idx->setUpEnvironment();
    if (!$idx->isRemoteReady()) {
        $idx->bootstrap();
    }
    $idx->remotePrepare();
    $idx->getStrategy()->deploy();
    $idx->remoteLinkSharedFolders();
    if ($idx->hasToMigrate()) {
        $idx->doctrineMigrate();
    }
    $idx->remote('cd ' . $idx->getNextReleaseFolder() . '/app/config && rm -f parameters.yml', !$go);
    $idx->remote('cd ' . $idx->getNextReleaseFolder() . '/app/config && ln -s parameters.' . $env . '.yml parameters.yml', !$go);
    $idx->cacheClear();
    $idx->switchToTheNextRelease();
    $idx->assetic();
    $idx->deleteOldReleases(6);
    $idx->remote('cd ' . $idx->getNextReleaseFolder() . ' && rm -Rf app/cache/*', !$go);
})->add('test:run', function ($filter = '') use($idx) {
    $idx->runTask('test:run-group', 'unit', $filter);
    $idx->runTask('test:run-group', 'integration', $filter);
    $idx->runTask('test:run-group', 'command', $filter);
    $idx->runTask('test:run-group', 'functional', $filter);
    $idx->runTask('test:run-group', 'functionalAdmin', $filter);
})->add('test:run-group', function ($group, $filter = "") use($idx) {
    if (!empty($filter)) {
        $filter = ' --filter ' . $filter;
Exemplo n.º 3
0
 /**
  * @expectedException \Exception
  * @expectedExceptionMessage Remote function need a valid environment. Specify --env parameter.
  */
 public function testRemoteException()
 {
     $output = new StreamOutput($this->output);
     $this->idx = new Idephix(array('test_target' => array()), new SSH\SshClient(new SSH\FakeSsh2Proxy($this)), $output);
     $this->idx->remote('echo foo');
 }