Merge pull request #2727 from appwrite/feat-add-builds-worker
Feat add builds worker
This commit is contained in:
commit
2ea285589c
|
@ -3,6 +3,7 @@
|
||||||
use Ahc\Jwt\JWT;
|
use Ahc\Jwt\JWT;
|
||||||
use Appwrite\Auth\Auth;
|
use Appwrite\Auth\Auth;
|
||||||
use Appwrite\Database\Validator\CustomId;
|
use Appwrite\Database\Validator\CustomId;
|
||||||
|
use Appwrite\Event\Event;
|
||||||
use Utopia\Database\Validator\UID;
|
use Utopia\Database\Validator\UID;
|
||||||
use Utopia\Storage\Storage;
|
use Utopia\Storage\Storage;
|
||||||
use Utopia\Storage\Validator\File;
|
use Utopia\Storage\Validator\File;
|
||||||
|
@ -580,7 +581,7 @@ App::post('/v1/functions/:functionId/deployments')
|
||||||
]));
|
]));
|
||||||
|
|
||||||
// Enqueue a message to start the build
|
// Enqueue a message to start the build
|
||||||
Resque::enqueue('v1-builds', 'BuildsV1', [
|
Resque::enqueue(Event::BUILDS_QUEUE_NAME, Event::BUILDS_CLASS_NAME, [
|
||||||
'projectId' => $project->getId(),
|
'projectId' => $project->getId(),
|
||||||
'functionId' => $function->getId(),
|
'functionId' => $function->getId(),
|
||||||
'deploymentId' => $deploymentId,
|
'deploymentId' => $deploymentId,
|
||||||
|
@ -1121,7 +1122,7 @@ App::post('/v1/builds/:buildId')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enqueue a message to start the build
|
// Enqueue a message to start the build
|
||||||
Resque::enqueue('v1-builds', 'BuildsV1', [
|
Resque::enqueue(Event::BUILDS_QUEUE_NAME, Event::BUILDS_CLASS_NAME, [
|
||||||
'projectId' => $project->getId(),
|
'projectId' => $project->getId(),
|
||||||
'buildId' => $buildId,
|
'buildId' => $buildId,
|
||||||
'type' => BUILD_TYPE_RETRY
|
'type' => BUILD_TYPE_RETRY
|
||||||
|
|
|
@ -222,6 +222,31 @@ services:
|
||||||
- _APP_DB_USER
|
- _APP_DB_USER
|
||||||
- _APP_DB_PASS
|
- _APP_DB_PASS
|
||||||
|
|
||||||
|
appwrite-worker-builds:
|
||||||
|
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||||
|
entrypoint: worker-builds
|
||||||
|
container_name: appwrite-worker-builds
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- appwrite
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- mariadb
|
||||||
|
environment:
|
||||||
|
- _APP_ENV
|
||||||
|
- _APP_REDIS_HOST
|
||||||
|
- _APP_REDIS_PORT
|
||||||
|
- _APP_REDIS_USER
|
||||||
|
- _APP_REDIS_PASS
|
||||||
|
- _APP_DB_HOST
|
||||||
|
- _APP_DB_PORT
|
||||||
|
- _APP_DB_SCHEMA
|
||||||
|
- _APP_DB_USER
|
||||||
|
- _APP_DB_PASS
|
||||||
|
- _APP_LOGGING_PROVIDER
|
||||||
|
- _APP_LOGGING_CONFIG
|
||||||
|
- _APP_EXECUTOR_SECRET
|
||||||
|
|
||||||
appwrite-worker-audits:
|
appwrite-worker-audits:
|
||||||
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
image: <?php echo $organization; ?>/<?php echo $image; ?>:<?php echo $version."\n"; ?>
|
||||||
entrypoint: worker-audits
|
entrypoint: worker-audits
|
||||||
|
|
|
@ -31,6 +31,9 @@ class Event
|
||||||
const CERTIFICATES_QUEUE_NAME = 'v1-certificates';
|
const CERTIFICATES_QUEUE_NAME = 'v1-certificates';
|
||||||
const CERTIFICATES_CLASS_NAME = 'CertificatesV1';
|
const CERTIFICATES_CLASS_NAME = 'CertificatesV1';
|
||||||
|
|
||||||
|
const BUILDS_QUEUE_NAME = 'v1-builds';
|
||||||
|
const BUILDS_CLASS_NAME = 'BuildsV1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -267,6 +267,34 @@ services:
|
||||||
- _APP_SMTP_HOST
|
- _APP_SMTP_HOST
|
||||||
- _APP_SMTP_PORT
|
- _APP_SMTP_PORT
|
||||||
|
|
||||||
|
appwrite-worker-builds:
|
||||||
|
entrypoint: worker-builds
|
||||||
|
container_name: appwrite-worker-builds
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
networks:
|
||||||
|
- appwrite
|
||||||
|
volumes:
|
||||||
|
- ./app:/usr/src/code/app
|
||||||
|
- ./src:/usr/src/code/src
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- mariadb
|
||||||
|
environment:
|
||||||
|
- _APP_ENV
|
||||||
|
- _APP_REDIS_HOST
|
||||||
|
- _APP_REDIS_PORT
|
||||||
|
- _APP_REDIS_USER
|
||||||
|
- _APP_REDIS_PASS
|
||||||
|
- _APP_DB_HOST
|
||||||
|
- _APP_DB_PORT
|
||||||
|
- _APP_DB_SCHEMA
|
||||||
|
- _APP_DB_USER
|
||||||
|
- _APP_DB_PASS
|
||||||
|
- _APP_LOGGING_PROVIDER
|
||||||
|
- _APP_LOGGING_CONFIG
|
||||||
|
- _APP_EXECUTOR_SECRET
|
||||||
|
|
||||||
appwrite-schedule:
|
appwrite-schedule:
|
||||||
entrypoint: schedule
|
entrypoint: schedule
|
||||||
container_name: appwrite-schedule
|
container_name: appwrite-schedule
|
||||||
|
|
Loading…
Reference in a new issue