Skip to content

Deploying To Stratus

NOTES:

  • Symlinks must use absolute paths.
  • CloudFront can take up to 15 minutes to clear.
  • Deployment Method 1

    The easiest way to deploy on Stratus is to continue doing deployments as you do now. You can SSH into Stratus and push your code, move symlinks, and flush caches. Most customers find that appending the Stratus cli commands below are the only additional steps required.

    /usr/share/stratus/cli autoscaling.reinit;
    sleep 5s;
    /usr/share/stratus/cli cache.all.clear;
    

    autoscaling.reinit performs a rolling update of the php-fpm containers. When you are scaled out this will ensure a seamless update across your scaled php-fpm services.

    sleep 5s pauses to wait rolling update of php-fpm containers to complete because autoscaling.reinit is called asynchronously.

    Deployment Method 2

    If you run into problems with files not clearing (and they are not js/css that could still be in the process of clearing from cloudfront) or you run issues with Magento cache on/off status being reported differently between the cli and admin, try the following deploy:

    Start:

    DISABLE CRON FIRST
    php bin/magento maintenance:enable;
    n98-magerun2 cache:disable;
    php bin/magento cache:flush;
    /usr/share/stratus/cli cache.all.clear;
    

    Your deployment commands, ex.:

    php bin/magento setup:upgrade;
    php bin/magento setup:di:compile;
    php bin/magento setup:static-content:deploy -f -j 10;
    php bin/magento indexer:reindex;
    

    End:

    n98-magerun2 cache:enable;
    /usr/share/stratus/cli autoscaling.reinit;
    sleep 5s;
    php bin/magento cache:flush;
    /usr/share/stratus/cli cache.all.clear;
    php bin/magento maintenance:disable;
    RE-ENABLE CRON!
    

    See also: