audunru
994
5
Forge

Clear cache before deploy?

Posted 1 year ago by audunru

I recently replaced a composer package with another (laravelba/laravel-js-routes to aaronlord/laroute). Removed the old one with composer remove.

On deploy I get this error.

@php artisan package:discover

In ProviderRepository.php line 208:
                                                                              
  Class 'LaravelBA\LaravelJsRoutes\LaravelJsRoutesServiceProvider' not found  
                                                                              

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

I've encountered it before, and clearing bootstrap/cache and redploying fixes it. Which leads me to believe clearing/removing the cache should be part of my deploy script. Does anyone know exactly what needs to be cleared/deleted, and if so, is there a artisan command to achieve this?

Here's my deploy script, maybe there's something there I should fix.

cd /home/forge/feedleback.com
php artisan down --message='Feedleback is being updated' --retry=180
git pull origin master
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
php artisan clear-compiled
php artisan config:cache
php artisan route:cache
php artisan cdn:push
php artisan queue:restart
php artisan up
php artisan opcache:clear

Please sign in or create an account to participate in this conversation.