From: Vincent Vanwaelscappel Date: Thu, 20 Jul 2023 06:40:40 +0000 (+0200) Subject: wip #6149 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=43ef663326eda30305d9df5949b982bb214e9ca4;p=fluidbook_processfarm.git wip #6149 @0.25 --- diff --git a/README.md b/README.md index f7ca9fa..cc62924 100644 --- 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 diff --git a/app/src/ProcessFile.php b/app/src/ProcessFile.php index 1c55cfb..272e478 100644 --- a/app/src/ProcessFile.php +++ b/app/src/ProcessFile.php @@ -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; diff --git a/updateall.bat b/updateall.bat index a13762d..e9572b8 100644 --- a/updateall.bat +++ b/updateall.bat @@ -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" diff --git a/updatecode.bat b/updatecode.bat index 7cc05b7..daae509 100644 --- a/updatecode.bat +++ b/updatecode.bat @@ -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"