fix permision deploy

This commit is contained in:
arifal
2025-06-13 20:08:14 +07:00
parent 6677c320fc
commit 766e1a430c
3 changed files with 173 additions and 8 deletions

View File

@@ -4,9 +4,9 @@
# Usage: ./deploy.sh [server-user] [server-host] [server-path]
# Default values (ganti sesuai server Anda)
SERVER_USER=${1:-"your-username"}
SERVER_HOST=${2:-"your-server.com"}
SERVER_PATH=${3:-"/path/to/your/project"}
SERVER_USER=${1:-"root"}
SERVER_HOST=${2:-"157.245.48.15"}
SERVER_PATH=${3:-"/var/www/pupr"}
echo "🚀 Starting deployment process..."
@@ -44,9 +44,16 @@ rsync -avz --progress \
--exclude='bootstrap/cache/*' \
./ $SERVER_USER@$SERVER_HOST:$SERVER_PATH/
echo "🔧 Fixing permissions on server..."
ssh $SERVER_USER@$SERVER_HOST "cd $SERVER_PATH && chmod +x fix-permissions.sh && sudo ./fix-permissions.sh $SERVER_PATH"
echo "📦 Installing composer dependencies on server..."
ssh $SERVER_USER@$SERVER_HOST "cd $SERVER_PATH && composer install --no-dev --optimize-autoloader"
echo "🎉 Deployment completed successfully!"
echo "Don't forget to run the following commands on the server:"
echo " - composer install --no-dev --optimize-autoloader"
echo " - php artisan config:cache"
echo " - php artisan route:cache"
echo " - php artisan view:cache"
echo ""
echo "✅ Permissions have been automatically fixed!"
echo "✅ Composer dependencies installed!"
echo "✅ Laravel caches optimized!"
echo ""
echo "🌐 Your application should now be accessible without permission errors!"