diff --git a/composer.json b/composer.json index 25659434c9..6fa56a4a31 100644 --- a/composer.json +++ b/composer.json @@ -69,7 +69,7 @@ "utopia-php/storage": "0.18.*", "utopia-php/swoole": "0.8.*", "utopia-php/system": "0.8.*", - "utopia-php/vcs": "0.6.*", + "utopia-php/vcs": "0.8.*", "utopia-php/websocket": "0.1.*", "matomo/device-detector": "6.1.*", "dragonmantank/cron-expression": "3.3.2", diff --git a/composer.lock b/composer.lock index 02bb9e7f4c..0062504883 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7a9af1063aac524865d2479ce3957d0e", + "content-hash": "b5c0db330bf30bd1d240b96116d96baf", "packages": [ { "name": "adhocore/jwt", @@ -2758,16 +2758,16 @@ }, { "name": "utopia-php/vcs", - "version": "0.6.7", + "version": "0.8.1", "source": { "type": "git", "url": "https://github.com/utopia-php/vcs.git", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974" + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/vcs/zipball/8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", - "reference": "8d8ff1ac68e991b95adb6f91fcde8f9bb8f24974", + "url": "https://api.github.com/repos/utopia-php/vcs/zipball/3084aa93d24ed1e70f01e75f4318fc0d07f12596", + "reference": "3084aa93d24ed1e70f01e75f4318fc0d07f12596", "shasum": "" }, "require": { @@ -2801,9 +2801,9 @@ ], "support": { "issues": "https://github.com/utopia-php/vcs/issues", - "source": "https://github.com/utopia-php/vcs/tree/0.6.7" + "source": "https://github.com/utopia-php/vcs/tree/0.8.1" }, - "time": "2024-06-05T17:38:29+00:00" + "time": "2024-07-29T20:49:09+00:00" }, { "name": "utopia-php/websocket", diff --git a/src/Appwrite/Platform/Workers/Builds.php b/src/Appwrite/Platform/Workers/Builds.php index 0b76086c96..41d2a27e73 100644 --- a/src/Appwrite/Platform/Workers/Builds.php +++ b/src/Appwrite/Platform/Workers/Builds.php @@ -218,7 +218,15 @@ class Builds extends Action $branchName = $deployment->getAttribute('providerBranch'); $commitHash = $deployment->getAttribute('providerCommitHash', ''); - $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $branchName, $tmpDirectory, $rootDirectory, $commitHash); + + $cloneVersion = $branchName; + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(!empty($commitHash)) { + $cloneVersion = $commitHash; + $cloneType = GitHub::CLONE_TYPE_COMMIT; + } + + $gitCloneCommand = $github->generateCloneCommand($cloneOwner, $cloneRepository, $cloneVersion, $cloneType, $tmpDirectory, $rootDirectory); $stdout = ''; $stderr = ''; Console::execute('mkdir -p /tmp/builds/' . \escapeshellcmd($buildId), '', $stdout, $stderr); @@ -241,7 +249,13 @@ class Builds extends Action if (!empty($templateRepositoryName) && !empty($templateOwnerName) && !empty($templateBranch)) { // Clone template repo $tmpTemplateDirectory = '/tmp/builds/' . \escapeshellcmd($buildId) . '/template'; - $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $tmpTemplateDirectory, $templateRootDirectory); + + $cloneType = GitHub::CLONE_TYPE_BRANCH; + if(\str_starts_with($templateBranch, '0.1.')) { // Temporary fix for 1.5. In future versions this only support tag names + $cloneType = GitHub::CLONE_TYPE_TAG; + } + + $gitCloneCommandForTemplate = $github->generateCloneCommand($templateOwnerName, $templateRepositoryName, $templateBranch, $cloneType, $tmpTemplateDirectory, $templateRootDirectory); $exit = Console::execute($gitCloneCommandForTemplate, '', $stdout, $stderr); if ($exit !== 0) {