Closed Afan417 closed 8 months ago
I would first check the logs of the deployments. Most probably your cloned repo has some changes that doesn't allow the 'git pull' command to be executed
Git pull works okay, after it finishes let's say composer install
it won't go to the next line, in this case npm install
, and just get's stuck "Deploying" status.
Sometimes it will not skip npm install
, but it will get stuck at npm run build
, it's weird.
If I run the script lines 1 by 1 and click deploy it works fine, but that's kinda annoying to do everytime.
Looks like a streaming problem when the commands are generating a long output.
Try to add --silent
to your npm command to not generate long outputs.
I tried, still did not work. It skips commands, it should wait and install the first command then go to the next line sequentially in order.
Could this be a PHP limitation, maybe I have to edit something in php.ini
?
Here's how my deployment script looks now:
composer install
npm install --silent
npm run build --silent
php artisan optimize:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan route:cache
php artisan statamic:stache:warm
php artisan queue:restart
php artisan statamic:search:update --all
php artisan statamic:static:clear
php artisan statamic:static:warm
php artisan statamic:assets:generate-presets --queue
Here's the output, it only ran 3 commands and stopped:
It's weird a bit. I will try to reproduce the issue
Could this be a case of resources, maybe due to lack of memory
@harmlessprince it could be. I would recommend at least 1GB memory
@saeedvaziry that is right, if one is running npm or node installation you might need more.
1gb is fare for composer related installations
My deployment script sometimes runs through all the commands fine, sometimes it only does half or 1 and 2 then stops/gets stuck, not sure if this a Vito issue or maybe a limitation on PHP's configuration or what, looking for any help here.
Here's my deployment script: