From 0aac303d51bb88639cfa163c8c8ab11061c366e8 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 2 Nov 2022 20:38:13 +0530 Subject: [PATCH] feat: rename rsync to volume-sync worker --- Dockerfile | 2 +- app/cli.php | 2 +- app/tasks/{rsync.php => volume-sync.php} | 3 +-- bin/certificate-sync | 3 --- bin/volume-sync | 3 +++ docker-compose.yml | 9 ++++----- 6 files changed, 10 insertions(+), 12 deletions(-) rename app/tasks/{rsync.php => volume-sync.php} (97%) delete mode 100644 bin/certificate-sync create mode 100644 bin/volume-sync diff --git a/Dockerfile b/Dockerfile index c44c9359e..d284e2a90 100755 --- a/Dockerfile +++ b/Dockerfile @@ -333,7 +333,7 @@ RUN mkdir -p /storage/uploads && \ # Executables RUN chmod +x /usr/local/bin/doctor && \ chmod +x /usr/local/bin/maintenance && \ - chmod +x /usr/local/bin/certificate-sync && \ + chmod +x /usr/local/bin/volume-sync && \ chmod +x /usr/local/bin/usage && \ chmod +x /usr/local/bin/install && \ chmod +x /usr/local/bin/migrate && \ diff --git a/app/cli.php b/app/cli.php index 34f4f999f..55704e47e 100644 --- a/app/cli.php +++ b/app/cli.php @@ -14,7 +14,7 @@ $cli = new CLI(); include 'tasks/doctor.php'; include 'tasks/maintenance.php'; -include 'tasks/rsync.php'; +include 'tasks/volume-sync.php'; include 'tasks/install.php'; include 'tasks/migrate.php'; include 'tasks/sdks.php'; diff --git a/app/tasks/rsync.php b/app/tasks/volume-sync.php similarity index 97% rename from app/tasks/rsync.php rename to app/tasks/volume-sync.php index 3ca5dfbe6..2114348b1 100644 --- a/app/tasks/rsync.php +++ b/app/tasks/volume-sync.php @@ -2,14 +2,13 @@ global $cli; -use Utopia\App; use Utopia\CLI\Console; use Utopia\Database\DateTime; use Utopia\Validator\Integer; use Utopia\Validator\Text; $cli - ->task('rsync') + ->task('volume-sync') ->desc('Runs rsync to sync certificates between the storage mount and traefik.') ->param('source', null, new Text(255), 'Source path to sync from.', false) ->param('destination', null, new Text(255), 'Destination path to sync to.', false) diff --git a/bin/certificate-sync b/bin/certificate-sync deleted file mode 100644 index 0d4b4718b..000000000 --- a/bin/certificate-sync +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -php /usr/src/code/app/cli.php rsync $@ \ No newline at end of file diff --git a/bin/volume-sync b/bin/volume-sync new file mode 100644 index 000000000..5190750a2 --- /dev/null +++ b/bin/volume-sync @@ -0,0 +1,3 @@ +#!/bin/sh + +php /usr/src/code/app/cli.php volume-sync $@ \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 8b2faf8e1..895c2a5e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -603,12 +603,11 @@ services: - _APP_MAINTENANCE_RETENTION_ABUSE - _APP_MAINTENANCE_RETENTION_AUDIT - appwrite-rsync: - entrypoint: certificate-sync + appwrite-volume-sync: + entrypoint: volume-sync <<: *x-logging - container_name: appwrite-rsync - build: - context: . + container_name: appwrite-volume-sync + image: appwrite-dev restart: unless-stopped command: - --source=/data/src/ --destination=/data/dest/ --interval=10