Merge pull request #9076 from appwrite/fix-dont-checkout-git-history

feat: delete git folder
This commit is contained in:
Christy Jacob 2024-12-11 19:11:04 +04:00 committed by GitHub
commit 3b93b33dc9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 57 additions and 56 deletions

106
composer.lock generated
View file

@ -709,16 +709,16 @@
},
{
"name": "google/protobuf",
"version": "v4.29.0",
"version": "v4.29.1",
"source": {
"type": "git",
"url": "https://github.com/protocolbuffers/protobuf-php.git",
"reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587"
"reference": "6042b5483f8029e42473faeb8ef75ba266278381"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/0ef6b2eb74b782f3f9023276c324d22e440f7587",
"reference": "0ef6b2eb74b782f3f9023276c324d22e440f7587",
"url": "https://api.github.com/repos/protocolbuffers/protobuf-php/zipball/6042b5483f8029e42473faeb8ef75ba266278381",
"reference": "6042b5483f8029e42473faeb8ef75ba266278381",
"shasum": ""
},
"require": {
@ -747,9 +747,9 @@
"proto"
],
"support": {
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.0"
"source": "https://github.com/protocolbuffers/protobuf-php/tree/v4.29.1"
},
"time": "2024-11-27T18:37:40+00:00"
"time": "2024-12-03T22:07:45+00:00"
},
{
"name": "jean85/pretty-package-versions",
@ -2565,12 +2565,12 @@
},
"type": "library",
"extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": {
"dev-main": "3.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
}
},
"autoload": {
@ -2724,8 +2724,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@ -2804,8 +2804,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@ -2970,10 +2970,10 @@
},
"type": "composer-plugin",
"extra": {
"class": "Nevay\\SPI\\Composer\\Plugin",
"branch-alias": {
"dev-main": "0.2.x-dev"
},
"class": "Nevay\\SPI\\Composer\\Plugin",
"plugin-optional": true
},
"autoload": {
@ -3678,16 +3678,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.14",
"version": "0.33.15",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "45a5a2db3602fa054096f378482c7da9936f5850"
"reference": "83b0628900c2c53e8c3efbf069f3e13050295edc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/45a5a2db3602fa054096f378482c7da9936f5850",
"reference": "45a5a2db3602fa054096f378482c7da9936f5850",
"url": "https://api.github.com/repos/utopia-php/http/zipball/83b0628900c2c53e8c3efbf069f3e13050295edc",
"reference": "83b0628900c2c53e8c3efbf069f3e13050295edc",
"shasum": ""
},
"require": {
@ -3719,9 +3719,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.14"
"source": "https://github.com/utopia-php/http/tree/0.33.15"
},
"time": "2024-11-20T12:39:10+00:00"
"time": "2024-12-10T13:07:04+00:00"
},
{
"name": "utopia-php/image",
@ -4575,16 +4575,16 @@
},
{
"name": "utopia-php/vcs",
"version": "0.8.5",
"version": "0.8.6",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/vcs.git",
"reference": "7622330628d53844a3873ca873338150756bab82"
"reference": "b10225f54d5670f09f83e82e09de9d820ada6931"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/vcs/zipball/7622330628d53844a3873ca873338150756bab82",
"reference": "7622330628d53844a3873ca873338150756bab82",
"url": "https://api.github.com/repos/utopia-php/vcs/zipball/b10225f54d5670f09f83e82e09de9d820ada6931",
"reference": "b10225f54d5670f09f83e82e09de9d820ada6931",
"shasum": ""
},
"require": {
@ -4618,9 +4618,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/vcs/issues",
"source": "https://github.com/utopia-php/vcs/tree/0.8.5"
"source": "https://github.com/utopia-php/vcs/tree/0.8.6"
},
"time": "2024-11-11T18:33:10+00:00"
"time": "2024-12-10T13:13:23+00:00"
},
{
"name": "utopia-php/websocket",
@ -4934,29 +4934,27 @@
},
{
"name": "doctrine/deprecations",
"version": "1.1.3",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/deprecations.git",
"reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab"
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
"reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab",
"url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9",
"reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9",
"shasum": ""
},
"require": {
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/coding-standard": "^9",
"phpstan/phpstan": "1.4.10 || 1.10.15",
"phpstan/phpstan-phpunit": "^1.0",
"doctrine/coding-standard": "^9 || ^12",
"phpstan/phpstan": "1.4.10 || 2.0.3",
"phpstan/phpstan-phpunit": "^1.0 || ^2",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"psalm/plugin-phpunit": "0.18.4",
"psr/log": "^1 || ^2 || ^3",
"vimeo/psalm": "4.30.0 || 5.12.0"
"psr/log": "^1 || ^2 || ^3"
},
"suggest": {
"psr/log": "Allows logging deprecations via PSR-3 logger implementation"
@ -4964,7 +4962,7 @@
"type": "library",
"autoload": {
"psr-4": {
"Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations"
"Doctrine\\Deprecations\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -4975,9 +4973,9 @@
"homepage": "https://www.doctrine-project.org/",
"support": {
"issues": "https://github.com/doctrine/deprecations/issues",
"source": "https://github.com/doctrine/deprecations/tree/1.1.3"
"source": "https://github.com/doctrine/deprecations/tree/1.1.4"
},
"time": "2024-01-30T19:34:25+00:00"
"time": "2024-12-07T21:18:45+00:00"
},
{
"name": "doctrine/instantiator",
@ -5809,16 +5807,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "5.6.0",
"version": "5.6.1",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c"
"reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c",
"reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
"reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8",
"shasum": ""
},
"require": {
@ -5867,9 +5865,9 @@
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"support": {
"issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0"
"source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1"
},
"time": "2024-11-12T11:25:25+00:00"
"time": "2024-12-07T09:39:29+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@ -7892,8 +7890,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@ -7968,8 +7966,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@ -8046,8 +8044,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {
@ -8124,8 +8122,8 @@
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
"url": "https://github.com/symfony/polyfill",
"name": "symfony/polyfill"
}
},
"autoload": {

View file

@ -209,8 +209,7 @@ class Builds extends Action
try {
if ($isNewBuild && !$isVcsEnabled) {
// Non-vcs+Template
// Non-VCS + Template
$templateRepositoryName = $template->getAttribute('repositoryName', '');
$templateOwnerName = $template->getAttribute('ownerName', '');
$templateVersion = $template->getAttribute('version', '');
@ -233,6 +232,8 @@ class Builds extends Action
throw new \Exception('Unable to clone code repository: ' . $stderr);
}
Console::execute('find ' . \escapeshellarg($tmpTemplateDirectory) . ' -type d -name ".git" -exec rm -rf {} +', '', $stdout, $stderr);
// Ensure directories
Console::execute('mkdir -p ' . \escapeshellarg($tmpTemplateDirectory . '/' . $templateRootDirectory), '', $stdout, $stderr);
@ -398,6 +399,8 @@ class Builds extends Action
throw new \Exception('Repository directory size should be less than ' . number_format($functionsSizeLimit / 1048576, 2) . ' MBs.');
}
Console::execute('find ' . \escapeshellarg($tmpDirectory) . ' -type d -name ".git" -exec rm -rf {} +', '', $stdout, $stderr);
$tarParamDirectory = '/tmp/builds/' . $buildId . '/code' . (empty($rootDirectory) ? '' : '/' . $rootDirectory);
Console::execute('tar --exclude code.tar.gz -czf ' . \escapeshellarg($tmpPathFile) . ' -C ' . \escapeshellcmd($tarParamDirectory) . ' .', '', $stdout, $stderr); // TODO: Replace escapeshellcmd with escapeshellarg if we find a way that doesnt break syntax