I have a bunch of different sites deployed on Forge. In one or two, I'm using Filament importing and exporting and thus I have a Queue Worker process running.
I noticed a difference between the deployment scripts for more recently created sites and older sites. One thing is that on the newer sites, there is this in the deployment script:
$RESTART_QUEUES()
On an older site where I'd also like to restart the queue when I deploy changes, I don't have that. I tried adding this line to the deployment script but it caused the deployment to fail. I'm guessing that's because the whole deployment process is different between the two sites.
Could I just copy the whole script (editing as needed to pertain to the site) from the newer site to the older one or are other steps needed to accomplish this? Alternatively, is there a difference command to use that would restart the queue and also work in the older style deployment script?
For reference, here is the entire script for the older site:
cd /home/forge/my-site.on-forge.com
git pull origin $FORGE_SITE_BRANCH
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
# Prevent concurrent php-fpm reloads...
touch /tmp/fpmlock 2>/dev/null || true
( flock -w 10 9 || exit 1
echo 'Reloading PHP FPM...'; sudo -S service $FORGE_PHP_FPM reload ) 9</tmp/fpmlock
npm ci && npm run build
And here's the whole script for the newer site:
$CREATE_RELEASE()
cd $FORGE_RELEASE_DIRECTORY
$FORGE_COMPOSER install --no-dev --no-interaction --prefer-dist --optimize-autoloader
$FORGE_PHP artisan optimize
$FORGE_PHP artisan storage:link
$FORGE_PHP artisan migrate --force
npm ci || npm install && npm run build
$ACTIVATE_RELEASE()
$RESTART_QUEUES()