-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ef0e8d
commit 1f0bf61
Showing
2 changed files
with
17 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,23 @@ | ||
cd /home/llmstxtdirectory/llmstxt.directory | ||
|
||
# Exit on error | ||
set -e | ||
|
||
echo "🚀 Starting production deployment..." | ||
|
||
# Pull the latest changes from the git repository | ||
echo "📥 Pulling latest changes..." | ||
git pull origin $FORGE_SITE_BRANCH | ||
|
||
# Install/update composer dependencies | ||
echo "📦 Installing dependencies..." | ||
chown -R llmstxtdirectory:llmstxtdirectory . | ||
chmod -R 775 . | ||
git config --global --add safe.directory /home/llmstxtdirectory/llmstxt.directory | ||
git fetch origin $FORGE_SITE_BRANCH | ||
git reset --hard origin/$FORGE_SITE_BRANCH | ||
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader --no-dev | ||
|
||
# Create necessary directories | ||
echo "📁 Setting up directories..." | ||
mkdir -p storage/logs | ||
mkdir -p public/logos | ||
|
||
# Set permissions | ||
echo "🔒 Setting permissions..." | ||
chmod -R 775 storage | ||
chmod -R 775 public/logos | ||
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 "🔄 Restarting PHP..." | ||
( flock -w 10 9 || exit 1 | ||
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock | ||
echo "✅ Deployment complete!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,23 @@ | ||
cd /home/stagingllmstxtdirectory/staging.llmstxt.directory | ||
|
||
# Exit on error | ||
set -e | ||
|
||
echo "🚀 Starting staging deployment..." | ||
|
||
# Pull the latest changes from the git repository | ||
echo "📥 Pulling latest changes..." | ||
git pull origin $FORGE_SITE_BRANCH | ||
|
||
# Install/update composer dependencies | ||
echo "📦 Installing dependencies..." | ||
chown -R stagingllmstxtdirectory:stagingllmstxtdirectory . | ||
chmod -R 775 . | ||
git config --global --add safe.directory /home/stagingllmstxtdirectory/staging.llmstxt.directory | ||
git fetch origin $FORGE_SITE_BRANCH | ||
git reset --hard origin/$FORGE_SITE_BRANCH | ||
$FORGE_COMPOSER install --no-interaction --prefer-dist --optimize-autoloader | ||
|
||
# Create necessary directories | ||
echo "📁 Setting up directories..." | ||
mkdir -p storage/logs | ||
mkdir -p public/logos | ||
|
||
# Set permissions | ||
echo "🔒 Setting permissions..." | ||
chmod -R 775 storage | ||
chmod -R 775 public/logos | ||
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 "✅ Staging deployment complete!" | ||
echo "🔄 Restarting PHP..." | ||
( flock -w 10 9 || exit 1 | ||
echo 'Restarting FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9>/tmp/fpmlock | ||
echo "✅ Deployment complete!" |