Skip to content

Commit

Permalink
Deployment scripts updated
Browse files Browse the repository at this point in the history
  • Loading branch information
screenfluent committed Nov 17, 2024
1 parent 8d334c4 commit 0f4f893
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
19 changes: 7 additions & 12 deletions forge/deploy.production.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#!/bin/bash

# Production deployment script
cd /home/llmstxtdirectory/llmstxt.directory

# Exit on error
set -e

# Turn on maintenance mode
php artisan down || true

echo "πŸš€ Starting production deployment..."

# Pull the latest changes from the git repository
echo "πŸ“₯ Pulling latest changes..."
git pull origin production
git pull origin $FORGE_SITE_BRANCH

# Install/update composer dependencies
echo "πŸ“¦ Installing dependencies..."
composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader --no-dev

# Create necessary directories
echo "πŸ“ Setting up directories..."
Expand All @@ -27,19 +22,19 @@ mkdir -p public/logos
echo "πŸ”’ Setting permissions..."
chmod -R 775 storage
chmod -R 775 public/logos
chown -R forge:forge .
chmod -R 775 db
chmod 775 .

# Ensure database exists
echo "πŸ—„οΈ Checking database..."
if [ ! -f "db/votes.db" ]; then
echo "⚠️ Database not found, initializing..."
php db/init.php
chmod 664 db/votes.db
fi

# Clear caches
echo "🧹 Clearing caches..."
php -r "if(function_exists('opcache_reset')) { opcache_reset(); }"

# Turn off maintenance mode
echo "βœ… Deployment complete!"
php artisan up || true
echo "βœ… Deployment complete!"
14 changes: 7 additions & 7 deletions forge/deploy.staging.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash

# Staging deployment script
cd /home/stagingllmstxtdirectory/staging.llmstxt.directory

# Exit on error
set -e
Expand All @@ -9,11 +7,11 @@ echo "πŸš€ Starting staging deployment..."

# Pull the latest changes from the git repository
echo "πŸ“₯ Pulling latest changes..."
git pull origin main
git pull origin $FORGE_SITE_BRANCH

# Install/update composer dependencies
echo "πŸ“¦ Installing dependencies..."
composer install --no-interaction --prefer-dist --optimize-autoloader
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader

# Create necessary directories
echo "πŸ“ Setting up directories..."
Expand All @@ -24,17 +22,19 @@ mkdir -p public/logos
echo "πŸ”’ Setting permissions..."
chmod -R 775 storage
chmod -R 775 public/logos
chown -R forge:forge .
chmod -R 775 db
chmod 775 .

# Ensure database exists
echo "πŸ—„οΈ Checking database..."
if [ ! -f "db/votes.db" ]; then
echo "⚠️ Database not found, initializing..."
php db/init.php
chmod 664 db/votes.db
fi

# Clear caches
echo "🧹 Clearing caches..."
php -r "if(function_exists('opcache_reset')) { opcache_reset(); }"

echo "βœ… Deployment complete!"
echo "βœ… Staging deployment complete!"

0 comments on commit 0f4f893

Please sign in to comment.