1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00
appwrite/app/workers/functions.php

51 lines
895 B
PHP
Raw Normal View History

2020-05-05 01:34:31 +12:00
<?php
2020-05-10 10:12:00 +12:00
use Utopia\CLI\Console;
2020-05-05 01:34:31 +12:00
use Utopia\Config\Config;
use Appwrite\Database\Database;
use Appwrite\Database\Validator\Authorization;
2020-05-09 18:26:18 +12:00
2020-05-10 04:39:50 +12:00
require_once __DIR__.'/../init.php';
cli_set_process_title('Functions V1 Worker');
Console::success(APP_NAME.' functions worker v1 has started');
2020-05-10 10:12:00 +12:00
$environments = Config::getParam('environments');
2020-05-09 18:26:18 +12:00
2020-05-10 10:12:00 +12:00
foreach($environments as $environment) {
2020-05-09 18:26:18 +12:00
$stdout = '';
$stderr = '';
2020-05-10 10:12:00 +12:00
Console::execute('docker pull '.$environment['image'], null, $stdout, $stderr);
2020-05-09 18:26:18 +12:00
2020-05-10 10:12:00 +12:00
if(!empty($stdout)) {
Console::success($stdout);
}
if(!empty($stderr)) {
Console::error($stderr);
}
2020-05-09 18:26:18 +12:00
}
2020-05-05 01:34:31 +12:00
class FunctionsV1
{
public $args = [];
2020-05-06 07:42:35 +12:00
public $images = [
];
2020-05-05 01:34:31 +12:00
public function setUp()
{
}
public function perform()
{
}
public function tearDown()
{
// ... Remove environment for this job
}
}