]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6555 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Dec 2023 08:20:33 +0000 (09:20 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 6 Dec 2023 08:20:33 +0000 (09:20 +0100)
app/Jobs/HostingUpdate.php
resources/hosting/server/update

index 974e75c6a394bd387e864c3f4ab6065ba4ee98c1..3078d0f7a5358ee54b73b0a63826a01639ad1e3a 100644 (file)
@@ -3,17 +3,18 @@
 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()
@@ -52,8 +53,7 @@ class HostingUpdate extends Base
 
         Files::recursiveReplaceStringInDir($d, [
             '$hosting' => $name,
-            '$updateall' => implode("\n", $updateAll),
-            '$ip' => $data['ip']
+            '$updateall' => implode("\n", $updateAll)
         ]);
 
         chmod($d . 'update', 0755);
@@ -61,6 +61,9 @@ class HostingUpdate extends Base
         $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();
     }
 }
index 5e7dc4ff26ab3f0ab1fd19f30309c866b8b2eb12..030d0b6a0413fb15d742284915dbb119aeed8224 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/sh
 cd /docker/fluidbook-$hosting/server-$sid/
-docker-compose pull
-docker-compose down
-docker-compose up -d
+docker compose pull
+docker compose down
+docker compose up -d