]> _ Git - fluidbook_processfarm.git/commitdiff
wip #6149 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 06:40:40 +0000 (08:40 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jul 2023 06:40:40 +0000 (08:40 +0200)
README.md
app/src/ProcessFile.php
updateall.bat
updatecode.bat

index f7ca9fa0ca213605ef4daa68c1ee92e3fe0712b8..cc62924515ca05e37cbc0054258fb6e9e018b11e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,4 +2,6 @@
 
 On the farming server : 
 
+If docker is not installed : `wget https://get.docker.com -O get-docker.sh && sh get-docker.sh`
+
 `apt install -y git docker-composer-plugin;mkdir -p /docker/fluidbook-processfarm;cd /docker/fluidbook-processfarm;git clone git://git.cubedesigners.com/fluidbook_processfarm.git .;./update`
\ No newline at end of file
index 1c55cfbb003e267d2c898cde98996f9205c03e7f..272e4780212c2fe3ddfd2e42efd09ddce8d2bc32 100644 (file)
@@ -6,10 +6,10 @@ use Cubist\PDF\PDFTools;
 use Cubist\Util\Files\Files;
 
 class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
-       protected const DISTANT_ROOT = '/application/fluidbook/docs/';
+       protected const DISTANT_ROOTS = ['/application/fluidbook/docs/', '/application/protected/fluidbookpublication/docs/'];
        protected const LOCAL_ROOT = '/files/';
 
-       protected const US_DISTANT_ROOT = '/application/usstorage/docs/';
+       protected const US_DISTANT_ROOTS = ['/application/usstorage/docs/'];
        protected const US_LOCAL_ROOT = '/usfiles/';
 
        /**
@@ -99,9 +99,14 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
 
        public function getOut() {
                if ($this->getRegion() === 'UE') {
-                       return str_replace(self::DISTANT_ROOT, self::LOCAL_ROOT, $this->getDistantOut());
+                       foreach (self::DISTANT_ROOTS as $dr) {
+                               return str_replace($dr, self::LOCAL_ROOT, $this->getDistantOut());
+                       }
                } else {
-                       return str_replace(self::US_DISTANT_ROOT, self::US_LOCAL_ROOT, $this->getDistantOut());
+                       foreach (self::US_DISTANT_ROOTS as $dr) {
+                               return str_replace($dr, self::US_LOCAL_ROOT, $this->getDistantOut());
+                       }
+
                }
        }
 
@@ -128,15 +133,15 @@ class ProcessFile extends \Fluidbook\Tools\Jobs\ProcessFile {
 
        public function process() {
                if ($this->getRegion() === 'UE') {
-                       return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOT, $this->getPath($this->isForce()));
+                       return str_replace(self::LOCAL_ROOT, self::DISTANT_ROOTS[0], $this->getPath($this->isForce()));
                } else {
-                       return str_replace(self::US_LOCAL_ROOT, self::US_DISTANT_ROOT, $this->getPath($this->isForce()));
+                       return str_replace(self::US_LOCAL_ROOT, self::US_DISTANT_ROOTS[0], $this->getPath($this->isForce()));
                }
        }
 
        public function getPdf(): string|null {
                $res = Files::firstThatExists($this->getOut() . '/crop.pdf', $this->getOut() . '/fixed.pdf', $this->getOut() . '/original.pdf');
-               if(null===$res) {
+               if (null === $res) {
                        echo 'no pdf in ' . $this->getOut();
                }
                return $res;
index a13762db72381b3e541162ea801938c7fbfe9235..e9572b85030aa9027293b75c8959eba2938234a0 100644 (file)
@@ -2,6 +2,7 @@ ssh root@alphaville.cubedesigners.com "/docker/fluidbook-processfarm/update"
 ssh root@brazil.cubedesigners.com "/docker/fluidbook-processfarm/update"
 ssh root@clockwork.cubedesigners.com "/docker/fluidbook-processfarm/update"
 ssh root@dracula.cubedesigners.com "/docker/fluidbook-processfarm/update"
+ssh root@dobermann.cubedesigners.com "/docker/fluidbook-processfarm/update"
 ssh root@192.168.10.5 -p 22822 "/docker/fluidbook-processfarm/update"
 ssh root@fastandfurious.cubedesigners.com -p 22822 "/docker/fluidbook-processfarm/update"
 ssh root@godzilla.cubedesigners.com "/docker/fluidbook-processfarm/update"
index 7cc05b780f1c6f70747589f5ce0762bdfa866a27..daae5094ee257cf1cf7c8076d27abafd27a93436 100644 (file)
@@ -2,6 +2,7 @@ ssh root@alphaville.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/u
 ssh root@brazil.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
 ssh root@clockwork.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
 ssh root@dracula.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
+ssh root@dobermann.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
 ssh root@192.168.10.5 -p 22822 "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
 ssh root@fastandfurious.cubedesigners.com -p 22822 "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"
 ssh root@godzilla.cubedesigners.com "chmod 755 /docker/fluidbook-processfarm/updatecode;/docker/fluidbook-processfarm/updatecode"