Merge pull request #1577 from TorstenDittmann/fix-functions-env-variable
fix(functions): environment variables
This commit is contained in:
commit
17d2a4bc0a
|
@ -414,8 +414,8 @@ class FunctionsV1 extends Worker
|
||||||
$orchestration->setMemory((int) App::getEnv('_APP_FUNCTIONS_MEMORY', 256));
|
$orchestration->setMemory((int) App::getEnv('_APP_FUNCTIONS_MEMORY', 256));
|
||||||
$orchestration->setSwap((int) App::getEnv('_APP_FUNCTIONS_MEMORY_SWAP', 256));
|
$orchestration->setSwap((int) App::getEnv('_APP_FUNCTIONS_MEMORY_SWAP', 256));
|
||||||
|
|
||||||
foreach ($vars as &$value) {
|
foreach ($vars as $key => $value) {
|
||||||
$value = strval($value);
|
$vars[$key] = strval($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = $orchestration->run(
|
$id = $orchestration->run(
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
"utopia-php/image": "0.5.*",
|
"utopia-php/image": "0.5.*",
|
||||||
"resque/php-resque": "1.3.6",
|
"resque/php-resque": "1.3.6",
|
||||||
"matomo/device-detector": "4.2.3",
|
"matomo/device-detector": "4.2.3",
|
||||||
"utopia-php/orchestration": "0.2.0",
|
"utopia-php/orchestration": "0.2.1",
|
||||||
"dragonmantank/cron-expression": "3.1.0",
|
"dragonmantank/cron-expression": "3.1.0",
|
||||||
"influxdb/influxdb-php": "1.15.2",
|
"influxdb/influxdb-php": "1.15.2",
|
||||||
"phpmailer/phpmailer": "6.5.0",
|
"phpmailer/phpmailer": "6.5.0",
|
||||||
|
|
15
composer.lock
generated
15
composer.lock
generated
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "86c1d7779c0c083c4493e154d6bb3ee0",
|
"content-hash": "e86dfb61222e6281eaa23561c5958534",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "adhocore/jwt",
|
"name": "adhocore/jwt",
|
||||||
|
@ -1909,16 +1909,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/orchestration",
|
"name": "utopia-php/orchestration",
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/utopia-php/orchestration.git",
|
"url": "https://github.com/utopia-php/orchestration.git",
|
||||||
"reference": "de10509017768cf2b62363bb39912002ab41dafb"
|
"reference": "55da7a331a45d5887de8122268dfccd15fee94d1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/de10509017768cf2b62363bb39912002ab41dafb",
|
"url": "https://api.github.com/repos/utopia-php/orchestration/zipball/55da7a331a45d5887de8122268dfccd15fee94d1",
|
||||||
"reference": "de10509017768cf2b62363bb39912002ab41dafb",
|
"reference": "55da7a331a45d5887de8122268dfccd15fee94d1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -1958,9 +1958,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/utopia-php/orchestration/issues",
|
"issues": "https://github.com/utopia-php/orchestration/issues",
|
||||||
"source": "https://github.com/utopia-php/orchestration/tree/0.2.0"
|
"source": "https://github.com/utopia-php/orchestration/tree/0.2.1"
|
||||||
},
|
},
|
||||||
"time": "2021-08-16T12:52:42+00:00"
|
"time": "2021-09-03T11:29:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "utopia-php/preloader",
|
"name": "utopia-php/preloader",
|
||||||
|
@ -4995,6 +4995,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"abandoned": true,
|
||||||
"time": "2020-09-28T06:45:17+00:00"
|
"time": "2020-09-28T06:45:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,6 +209,7 @@ class FunctionsCustomClientTest extends Scope
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
$this->assertEquals($this->getUser()['$id'], $output['APPWRITE_FUNCTION_USER_ID']);
|
||||||
$this->assertNotEmpty($output['APPWRITE_FUNCTION_JWT']);
|
$this->assertNotEmpty($output['APPWRITE_FUNCTION_JWT']);
|
||||||
|
$this->assertEquals($projectId, $output['APPWRITE_FUNCTION_PROJECT_ID']);
|
||||||
|
|
||||||
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', [
|
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', [
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
|
|
|
@ -606,6 +606,7 @@ class FunctionsCustomServerTest extends Scope
|
||||||
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
$this->assertEquals('foobar', $output['APPWRITE_FUNCTION_DATA']);
|
||||||
$this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']);
|
$this->assertEquals('', $output['APPWRITE_FUNCTION_USER_ID']);
|
||||||
$this->assertEmpty($output['APPWRITE_FUNCTION_JWT']);
|
$this->assertEmpty($output['APPWRITE_FUNCTION_JWT']);
|
||||||
|
$this->assertEquals($this->getProject()['$id'], $output['APPWRITE_FUNCTION_PROJECT_ID']);
|
||||||
|
|
||||||
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
|
$executions = $this->client->call(Client::METHOD_GET, '/functions/'.$functionId.'/executions', array_merge([
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
|
|
Binary file not shown.
|
@ -29,6 +29,7 @@ $output = [
|
||||||
'APPWRITE_FUNCTION_DATA' => $_ENV['APPWRITE_FUNCTION_DATA'],
|
'APPWRITE_FUNCTION_DATA' => $_ENV['APPWRITE_FUNCTION_DATA'],
|
||||||
'APPWRITE_FUNCTION_USER_ID' => $_ENV['APPWRITE_FUNCTION_USER_ID'],
|
'APPWRITE_FUNCTION_USER_ID' => $_ENV['APPWRITE_FUNCTION_USER_ID'],
|
||||||
'APPWRITE_FUNCTION_JWT' => $_ENV['APPWRITE_FUNCTION_JWT'],
|
'APPWRITE_FUNCTION_JWT' => $_ENV['APPWRITE_FUNCTION_JWT'],
|
||||||
|
'APPWRITE_FUNCTION_PROJECT_ID' => $_ENV['APPWRITE_FUNCTION_PROJECT_ID'],
|
||||||
];
|
];
|
||||||
|
|
||||||
echo json_encode($output);
|
echo json_encode($output);
|
||||||
|
|
Loading…
Reference in a new issue