mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Expose build enabled specifications
This commit is contained in:
1 parent
aae23cf5a1
commit
419cd2e356
5 files changed
+19
-1
No files matched your search
@@ -58,10 +58,14 @@ class XList extends Base
|
||||
$specs = [];
|
||||
foreach ($allSpecs as $spec) {
|
||||
$spec['enabled'] = true;
|
||||
$spec['buildEnabled'] = true;
|
||||
|
||||
if (array_key_exists('runtimeSpecifications', $plan)) {
|
||||
$spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']);
|
||||
}
|
||||
if (array_key_exists('buildSpecifications', $plan)) {
|
||||
$spec['buildEnabled'] = in_array($spec['slug'], $plan['buildSpecifications']);
|
||||
}
|
||||
|
||||
$maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0);
|
||||
$maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0);
|
||||
|
||||
@@ -58,10 +58,14 @@ class XList extends Base
|
||||
$specs = [];
|
||||
foreach ($allSpecs as $spec) {
|
||||
$spec['enabled'] = true;
|
||||
$spec['buildEnabled'] = true;
|
||||
|
||||
if (array_key_exists('runtimeSpecifications', $plan)) {
|
||||
$spec['enabled'] = in_array($spec['slug'], $plan['runtimeSpecifications']);
|
||||
}
|
||||
if (array_key_exists('buildSpecifications', $plan)) {
|
||||
$spec['buildEnabled'] = in_array($spec['slug'], $plan['buildSpecifications']);
|
||||
}
|
||||
|
||||
$maxCpus = System::getEnv('_APP_COMPUTE_CPUS', 0);
|
||||
$maxMemory = System::getEnv('_APP_COMPUTE_MEMORY', 0);
|
||||
|
||||
@@ -24,7 +24,13 @@ class Specification extends Model
|
||||
]);
|
||||
$this->addRule('enabled', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Is size enabled.',
|
||||
'description' => 'Is size enabled for runtime.',
|
||||
'default' => false,
|
||||
'example' => true
|
||||
]);
|
||||
$this->addRule('buildEnabled', [
|
||||
'type' => self::TYPE_BOOLEAN,
|
||||
'description' => 'Is size enabled for builds.',
|
||||
'default' => false,
|
||||
'example' => true
|
||||
]);
|
||||
|
||||
@@ -208,10 +208,12 @@ final class FunctionsCustomServerTest extends Scope
|
||||
$this->assertArrayHasKey('memory', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('cpus', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('enabled', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('buildEnabled', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('slug', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('memory', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('cpus', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('enabled', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('buildEnabled', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('slug', $specifications['body']['specifications'][1]);
|
||||
|
||||
$function = $this->createFunction([
|
||||
|
||||
@@ -34,10 +34,12 @@ final class SitesCustomServerTest extends Scope
|
||||
$this->assertArrayHasKey('memory', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('cpus', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('enabled', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('buildEnabled', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('slug', $specifications['body']['specifications'][0]);
|
||||
$this->assertArrayHasKey('memory', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('cpus', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('enabled', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('buildEnabled', $specifications['body']['specifications'][1]);
|
||||
$this->assertArrayHasKey('slug', $specifications['body']['specifications'][1]);
|
||||
|
||||
$site = $this->createSite([
|
||||
|
||||
Reference in new issue
Block a user