From 71120d11d7dd1752141999aa364cf66b63392feb Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 2 Jun 2025 17:18:05 +0200 Subject: [PATCH] #7567 --- src/CommandLine/LocalToGCSRclone.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CommandLine/LocalToGCSRclone.php b/src/CommandLine/LocalToGCSRclone.php index 0ca423d..3e8484f 100644 --- a/src/CommandLine/LocalToGCSRclone.php +++ b/src/CommandLine/LocalToGCSRclone.php @@ -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'); -- 2.39.5