namespace App\Jobs;
use App\Models\FluidbookExternalInstallServer;
+use Cubist\Net\SSH2;
+use Cubist\Util\CommandLine;
use Cubist\Util\CommandLine\Rsync;
use Cubist\Util\Files\Files;
use Cubist\Util\Text;
class HostingUpdate extends Base
{
-
protected static $_data = [
- 'hosting' => ['host' => 'clockwork.cubedesigners.com', 'basepath' => '/data/fluidbook/hosting', 'ip' => '178.33.250.33'],
- 'hosting2' => ['host' => 'clockwork.cubedesigners.com', 'basepath' => '/data/fluidbook/hosting2', 'ip' => '213.186.47.100'],
- //'ushosting' => ['host' => 'kingkong.cubedesigners.com', 'basepath' => '/home/fluidbook/data/hosting', 'ip' => '134.148.91.250'],
+ 'hosting' => ['host' => 'clockwork.cubedesigners.com', 'basepath' => '/data/fluidbook/hosting'],
+ 'hosting2' => ['host' => 'clockwork.cubedesigners.com', 'basepath' => '/data/fluidbook/hosting2'],
+ 'ushosting' => ['host' => 'kingkong.cubedesigners.com', 'basepath' => '/home/fluidbook/data/hosting'],
];
public function handle()
Files::recursiveReplaceStringInDir($d, [
'$hosting' => $name,
- '$updateall' => implode("\n", $updateAll),
- '$ip' => $data['ip']
+ '$updateall' => implode("\n", $updateAll)
]);
chmod($d . 'update', 0755);
$rsync->setMirror(true);
$rsync->execute();
-
+ $update = new CommandLine('./update');
+ $update->cd('/docker/fluidbook-' . $name);
+ $update->setSSH($data['host'], 'root', null, 22, '/application/.ssh/id_rsa');
+ $update->execute();
}
}