Merge pull request #835 from appwrite/feat-new-ruby-version
Added a Ruby env
This commit is contained in:
commit
a398640659
|
@ -43,6 +43,14 @@ return [
|
|||
'build' => '/usr/src/code/docker/environments/ruby-2.7',
|
||||
'logo' => 'ruby.png',
|
||||
],
|
||||
'ruby-3.0' => [
|
||||
'name' => 'Ruby',
|
||||
'version' => '3.0',
|
||||
'base' => 'ruby:3.0-alpine',
|
||||
'image' => 'appwrite/env-ruby-3.0:1.0.0',
|
||||
'build' => '/usr/src/code/docker/environments/ruby-3.0',
|
||||
'logo' => 'ruby.png',
|
||||
],
|
||||
'python-3.8' => [
|
||||
'name' => 'Python',
|
||||
'version' => '3.8',
|
||||
|
|
|
@ -26,3 +26,6 @@ docker buildx build --platform linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
|
|||
|
||||
echo 'Ruby 2.7...'
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-ruby-2.7:1.0.2 ./docker/environments/ruby-2.7/ --push
|
||||
|
||||
echo 'Ruby 3.0...'
|
||||
docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/ppc64le -t appwrite/env-ruby-3.0:1.0.0 ./docker/environments/ruby-3.0/ --push
|
||||
|
|
12
docker/environments/ruby-3.0/Dockerfile
Normal file
12
docker/environments/ruby-3.0/Dockerfile
Normal file
|
@ -0,0 +1,12 @@
|
|||
FROM ruby:3.0-alpine
|
||||
|
||||
LABEL maintainer="team@appwrite.io"
|
||||
|
||||
RUN apk add tar
|
||||
|
||||
RUN mkdir /usr/local/src
|
||||
|
||||
WORKDIR /usr/local/src/
|
||||
|
||||
ENV GEM_PATH=/usr/local/src/.appwrite
|
||||
ENV GEM_SPEC_CACHE=/usr/local/src/.appwrite/specs
|
|
@ -455,24 +455,6 @@ class FunctionsCustomServerTest extends Scope
|
|||
|
||||
public function testENVS():array
|
||||
{
|
||||
sleep(120);
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$file = $this->client->call(Client::METHOD_POST, '/storage/files', array_merge([
|
||||
'content-type' => 'multipart/form-data',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'),
|
||||
'read' => ['*'],
|
||||
'write' => ['*'],
|
||||
'folderId' => 'xyz',
|
||||
]);
|
||||
|
||||
$this->assertEquals($file['headers']['status-code'], 201);
|
||||
$this->assertNotEmpty($file['body']['$id']);
|
||||
|
||||
$fileId = $file['body']['$id'] ?? '';
|
||||
|
||||
$functions = realpath(__DIR__ . '/../../../resources/functions');
|
||||
|
||||
|
@ -529,6 +511,14 @@ class FunctionsCustomServerTest extends Scope
|
|||
'command' => 'ruby app.rb',
|
||||
'timeout' => 15,
|
||||
],
|
||||
[
|
||||
'language' => 'Ruby',
|
||||
'version' => '3.0',
|
||||
'name' => 'ruby-3.0',
|
||||
'code' => $functions.'/ruby.tar.gz',
|
||||
'command' => 'ruby app.rb',
|
||||
'timeout' => 15,
|
||||
],
|
||||
[
|
||||
'language' => 'Deno',
|
||||
'version' => '1.5',
|
||||
|
@ -547,6 +537,26 @@ class FunctionsCustomServerTest extends Scope
|
|||
],
|
||||
];
|
||||
|
||||
sleep(count($envs) * 25);
|
||||
|
||||
/**
|
||||
* Test for SUCCESS
|
||||
*/
|
||||
$file = $this->client->call(Client::METHOD_POST, '/storage/files', array_merge([
|
||||
'content-type' => 'multipart/form-data',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'file' => new CURLFile(realpath(__DIR__ . '/../../../resources/logo.png'), 'image/png', 'logo.png'),
|
||||
'read' => ['*'],
|
||||
'write' => ['*'],
|
||||
'folderId' => 'xyz',
|
||||
]);
|
||||
|
||||
$this->assertEquals($file['headers']['status-code'], 201);
|
||||
$this->assertNotEmpty($file['body']['$id']);
|
||||
|
||||
$fileId = $file['body']['$id'] ?? '';
|
||||
|
||||
foreach ($envs as $key => $env) {
|
||||
$language = $env['language'] ?? '';
|
||||
$version = $env['version'] ?? '';
|
||||
|
|
Loading…
Reference in a new issue