1
0
Fork 0
mirror of synced 2024-09-28 07:21:35 +12:00

Merge pull request #858 from TorstenDittmann/setup-qa

Fixes Install script
This commit is contained in:
Eldad A. Fux 2021-01-29 23:54:14 +02:00 committed by GitHub
commit 274cade225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 11 deletions

View file

@ -165,7 +165,7 @@ return [
], ],
[ [
'name' => '_APP_DB_USER', 'name' => '_APP_DB_USER',
'description' => 'MariaDB server user name. Default value is: \'root\'.', 'description' => 'MariaDB server user name. Default value is: \'user\'.',
'introduction' => '', 'introduction' => '',
'default' => 'user', 'default' => 'user',
'required' => false, 'required' => false,
@ -341,7 +341,7 @@ return [
'name' => '_APP_FUNCTIONS_MEMORY', 'name' => '_APP_FUNCTIONS_MEMORY',
'description' => 'The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is 128.', 'description' => 'The maximum amount of memory a single cloud function is allowed to use in megabytes. The default value is 128.',
'introduction' => '0.7.0', 'introduction' => '0.7.0',
'default' => '128', 'default' => '256',
'required' => false, 'required' => false,
'question' => '', 'question' => '',
], ],

View file

@ -6,14 +6,12 @@ use Appwrite\Docker\Compose;
use Appwrite\Docker\Env; use Appwrite\Docker\Env;
use Utopia\CLI\Console; use Utopia\CLI\Console;
use Utopia\Config\Config; use Utopia\Config\Config;
use Utopia\Validator\Mock;
use Utopia\View; use Utopia\View;
$cli $cli
->task('install') ->task('install')
->desc('Install Appwrite') ->desc('Install Appwrite')
->param('version', APP_VERSION_STABLE, new Mock(), 'Appwrite version', true) ->action(function () {
->action(function ($version) {
/** /**
* 1. Start - DONE * 1. Start - DONE
* 2. Check for older setup and get older version - DONE * 2. Check for older setup and get older version - DONE
@ -130,7 +128,7 @@ $cli
$templateForCompose $templateForCompose
->setParam('httpPort', $httpPort) ->setParam('httpPort', $httpPort)
->setParam('httpsPort', $httpsPort) ->setParam('httpsPort', $httpsPort)
->setParam('version', $version) ->setParam('version', APP_VERSION_STABLE)
; ;
$templateForEnv $templateForEnv
@ -147,12 +145,19 @@ $cli
Console::exit(1); Console::exit(1);
} }
$env = '';
$stdout = ''; $stdout = '';
$stderr = ''; $stderr = '';
foreach ($input as $key => $value) {
if($value) {
$env .= $key.'='.$value.' ';
}
}
Console::log("Running \"docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans --renew-anon-volumes\""); Console::log("Running \"docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans --renew-anon-volumes\"");
$exit = Console::execute("docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans --renew-anon-volumes", '', $stdout, $stderr); $exit = Console::execute("${env} docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans --renew-anon-volumes", '', $stdout, $stderr);
if ($exit !== 0) { if ($exit !== 0) {
Console::error("Failed to install Appwrite dockers"); Console::error("Failed to install Appwrite dockers");

View file

@ -266,10 +266,9 @@ services:
- _APP_SMTP_PASSWORD - _APP_SMTP_PASSWORD
appwrite-maintenance: appwrite-maintenance:
image: appwrite/appwrite:<?php echo $version."\n"; ?>
entrypoint: maintenance entrypoint: maintenance
container_name: appwrite-maintenance container_name: appwrite-maintenance
build:
context: .
restart: unless-stopped restart: unless-stopped
networks: networks:
- appwrite - appwrite
@ -307,8 +306,6 @@ services:
- appwrite - appwrite
volumes: volumes:
- appwrite-mariadb:/var/lib/mysql:rw - appwrite-mariadb:/var/lib/mysql:rw
ports:
- "3306:3306"
environment: environment:
- MYSQL_ROOT_PASSWORD=rootsecretpassword - MYSQL_ROOT_PASSWORD=rootsecretpassword
- MYSQL_DATABASE=${_APP_DB_SCHEMA} - MYSQL_DATABASE=${_APP_DB_SCHEMA}