From 268bf371df5b7f1b16f68227a0705ce2261526ea Mon Sep 17 00:00:00 2001 From: Bulut Kuru Date: Fri, 27 Mar 2026 14:23:27 +0300 Subject: [PATCH] Fix Drone test deploy without sudo --- scripts/deploy-test.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/deploy-test.sh b/scripts/deploy-test.sh index 1bacf63..c0428db 100755 --- a/scripts/deploy-test.sh +++ b/scripts/deploy-test.sh @@ -15,11 +15,10 @@ cd "$PROJECT_DIR" git config --global --add safe.directory "$PROJECT_DIR" || true -sudo chown -R "$USER":www-data storage bootstrap/cache 2>/dev/null || true -sudo find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true -sudo find storage -type f -exec chmod 664 {} \; 2>/dev/null || true -sudo find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true -sudo find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true +find storage -type d -exec chmod 2775 {} \; 2>/dev/null || true +find storage -type f -exec chmod 664 {} \; 2>/dev/null || true +find bootstrap/cache -type d -exec chmod 2775 {} \; 2>/dev/null || true +find bootstrap/cache -type f -exec chmod 664 {} \; 2>/dev/null || true git fetch origin git checkout "$BRANCH" @@ -38,10 +37,9 @@ if ! grep -q '^APP_KEY=base64:' .env; then exit 1 fi -sudo mkdir -p "$UPLOADS_DIR"/{images,videos,hero-slides,settings,pages,courses,announcements,categories} -sudo chown -R "$USER":www-data "$UPLOADS_DIR" 2>/dev/null || true -sudo find "$UPLOADS_DIR" -type d -exec chmod 2775 {} \; 2>/dev/null || true -sudo find "$UPLOADS_DIR" -type f -exec chmod 664 {} \; 2>/dev/null || true +mkdir -p "$UPLOADS_DIR"/{images,videos,hero-slides,settings,pages,courses,announcements,categories} +find "$UPLOADS_DIR" -type d -exec chmod 2775 {} \; 2>/dev/null || true +find "$UPLOADS_DIR" -type f -exec chmod 664 {} \; 2>/dev/null || true docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" down --remove-orphans || true docker compose -p "$COMPOSE_PROJECT" -f "$COMPOSE_FILE" up -d --build