From 4a4713ba821617ffae70e3479062b487086953ca Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 28 Nov 2023 17:20:28 +0100 Subject: [PATCH] :paperclip: Improve reporting of mc client on start-dev and repl scripts --- backend/scripts/repl | 11 +++++++---- backend/scripts/start-dev | 12 ++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/backend/scripts/repl b/backend/scripts/repl index afc6baeae..0e55dd77d 100755 --- a/backend/scripts/repl +++ b/backend/scripts/repl @@ -45,10 +45,13 @@ export PENPOT_FLAGS="\ # export PENPOT_AUDIT_LOG_ARCHIVE_URI="http://localhost:6070/api/audit" # Initialize MINIO config -mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin -mc admin user add penpot-s3 penpot-devenv penpot-devenv -mc admin policy attach penpot-s3 readwrite --user=penpot-devenv -mc mb penpot-s3/penpot -p +mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin -q +mc admin user add penpot-s3 penpot-devenv penpot-devenv -q +mc admin policy list penpot-s3 | grep -F -q -x "readwrite" +if [ "$?" = "1" ]; then + mc admin policy attach penpot-s3 readwrite --user=penpot-devenv -q +fi +mc mb penpot-s3/penpot -p -q export AWS_ACCESS_KEY_ID=penpot-devenv export AWS_SECRET_ACCESS_KEY=penpot-devenv diff --git a/backend/scripts/start-dev b/backend/scripts/start-dev index d0c50dca9..a62fc5d3d 100755 --- a/backend/scripts/start-dev +++ b/backend/scripts/start-dev @@ -23,11 +23,15 @@ export PENPOT_FLAGS="\ disable-soft-file-schema-validation \ disable-soft-file-validation"; + # Initialize MINIO config -mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin -mc admin user add penpot-s3 penpot-devenv penpot-devenv -mc admin policy attach penpot-s3 readwrite --user=penpot-devenv -mc mb penpot-s3/penpot -p +mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin -q +mc admin user add penpot-s3 penpot-devenv penpot-devenv -q +mc admin policy list penpot-s3 | grep -F -q -x "readwrite" +if [ "$?" = "1" ]; then + mc admin policy attach penpot-s3 readwrite --user=penpot-devenv -q +fi +mc mb penpot-s3/penpot -p -q export AWS_ACCESS_KEY_ID=penpot-devenv export AWS_SECRET_ACCESS_KEY=penpot-devenv