1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Merge pull request #835 from appwrite/feat-new-ruby-version

Added a Ruby env
This commit is contained in:
Eldad A. Fux 2021-01-20 09:40:23 +02:00 committed by GitHub
commit a398640659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 18 deletions

View file

@ -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',

View file

@ -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

View 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

View file

@ -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'] ?? '';