]> _ Git - cubist_util.git/commitdiff
#7567
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Jun 2025 15:18:05 +0000 (17:18 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 2 Jun 2025 15:18:05 +0000 (17:18 +0200)
src/CommandLine/LocalToGCSRclone.php

index 0ca423dd092ad69fc31c52e715b90147a9728783..3e8484fcaedf6f5397194155dec4537a21bd7e48 100644 (file)
@@ -3,6 +3,7 @@
 namespace Cubist\Util\CommandLine;
 
 use Cubist\Net\Transfer\IServer;
+use Cubist\Util\Files\Files;
 
 class LocalToGCSRclone extends CloneProgram
 {
@@ -13,9 +14,12 @@ class LocalToGCSRclone extends CloneProgram
     protected function _preExecute()
     {
         parent::_preExecute();
+        $tmp = Files::tempnam();
+        file_put_contents($tmp, $this->getGCSServiceAccountKey());
         $this->setArg(null, $this->getMirror() ? 'sync' : 'copy');
         $this->setArg(null, $this->getSrc());
-        $this->setArg('gcs-service-account-credentials', $this->getGCSServiceAccountKey());
+        $this->setArg('gcs-service-account-file', $tmp);
+        $this->setArg('gcs-bucket-policy-only');
 
         if ($this->isDryRun()) {
             $this->setArg('dry-run');