mirror of
https://github.com/mivodev/mivo.git
synced 2026-01-25 21:18:49 +07:00
feat: Add aaPanel deployment script and exclude it from git archives.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -19,3 +19,4 @@
|
||||
/serve.bat export-ignore
|
||||
/phpstan.neon export-ignore
|
||||
/phpunit.xml export-ignore
|
||||
/aapanel_deploy.sh export-ignore
|
||||
50
aapanel_deploy.sh
Normal file
50
aapanel_deploy.sh
Normal file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# aaPanel Webhook Deployment Script for Mivo
|
||||
# Path: /www/wwwroot/<your_project_path>
|
||||
|
||||
PROJECT_PATH="/www/wwwroot/<your_project_path>"
|
||||
|
||||
echo "---------------------------------------"
|
||||
echo "Starting Deployment: $(date)"
|
||||
echo "---------------------------------------"
|
||||
|
||||
if [ ! -d "$PROJECT_PATH" ]; then
|
||||
echo "Error: Project directory $PROJECT_PATH not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $PROJECT_PATH || exit
|
||||
|
||||
# 1. Pull latest changes
|
||||
echo "Step 1: Pulling latest changes from Git..."
|
||||
git pull origin main # Adjust branch name if necessary
|
||||
|
||||
# 2. Install PHP dependencies
|
||||
if [ -f "composer.json" ]; then
|
||||
echo "Step 2: Installing PHP dependencies..."
|
||||
composer install --no-interaction --optimize-autoloader --no-dev
|
||||
fi
|
||||
|
||||
# 3. Build Assets
|
||||
if [ -f "package.json" ]; then
|
||||
echo "Step 3: Building assets..."
|
||||
# If node_modules doesn't exist, install first
|
||||
if [ ! -d "node_modules" ]; then
|
||||
npm install
|
||||
fi
|
||||
npm run build
|
||||
fi
|
||||
|
||||
# 4. Set Permissions
|
||||
echo "Step 4: Setting permissions..."
|
||||
chown -R www:www .
|
||||
chmod +x mivo
|
||||
chmod -R 755 public
|
||||
# If there's a storage directory (MVC style usually has one)
|
||||
if [ -d "storage" ]; then
|
||||
chmod -R 775 storage
|
||||
fi
|
||||
|
||||
echo "---------------------------------------"
|
||||
echo "Deployment Finished Successfully!"
|
||||
echo "---------------------------------------"
|
||||
Reference in New Issue
Block a user