public function deploy()
{
$releaseId = $this->dataBase->startRelease();
$ssh = new Net_SSH2(SSH_SERVER);
$key = new Crypt_RSA();
$key->setPassword(SSH_PASSWORD);
$key->loadKey(file_get_contents(PATH_TO_PRIVATE_KEY));
if (!$ssh->login(SSH_LOGIN, $key)) {
$this->dataBase->logStep($releaseId, 'ssh ' . SSH_SERVER, ['error' => 'Login failed'], 1);
exit('Login Failed');
}
$ssh->enableQuietMode();
$command = $this->bash->dtLock('sandbox-mercury', 'mercury');
$output['success'] = $ssh->exec($command);
$output['error'] = $ssh->getStdError();
$this->dataBase->logStep($releaseId, $command, $output, $ssh->getExitStatus());
$command = $this->bash->dtPrep('sandbox-mercury', 'mercury', ["mercury" => "dev"]);
$output['success'] = $ssh->exec($command);
$output['error'] = $ssh->getStdError();
$this->dataBase->logStep($releaseId, $command, $output, $ssh->getExitStatus());
$command = $this->bash->dtPush('sandbox-mercury', 'mercury');
$output['success'] = $ssh->exec($command);
$output['error'] = $ssh->getStdError();
$this->dataBase->logStep($releaseId, $command, $output, $ssh->getExitStatus());
}