Skip to content

Stratus CLI

The Stratus CLI is available to run cache clearing and a few other commands for ease of use in your deployments. All the commands are detailed below.

To get started you can type /usr/share/stratus/cli help

Then a list of commands is viewable with brief descriptions.

The format is always /usr/share/stratus/cli <command> i.e. /usr/share/stratus/cli database.config

autoscaling.reinit

If you have autoscaling enabled, this command will issue a redeploy of PHP-FPM services and update code copied out to the various physical nodes. This is a rolling redeploy for zero instance downtime & minimal site downtime. The command executes asynchronously and will return before all the redeploy is completed. PLEASE NOTE: On average a redeploy takes several seconds & depends on the size of your code base.

cache.all.clear

Clears everything, CloudFront, PHP OpCache, Redis cache and Varnish (if applicable). CloudFront can take up to 15 minutes to clear on all the edge nodes.

cache.opcache.flush

Flush only the PHP OpCache.

cache.redis.clear

Flushes Redis, equivalent to redis-cli -h redis flushall.

cache.varnish.clear

Purges Varnish.

database.config

Returns your database credentials in JSON format.

magento.install

Installs latest Magento 2 – this is DESTRUCTIVE and will delete your data.

php.options.add

Lets you add PHP values such a memory_limit etc i.e. Ex. php.options.add memory_limit=4096M and so on

php.options.remove

The opposite of add in the same format.

examples

For example, lets clear all the things!

magemojo@svc-magentoperformance-io:~$ /usr/share/stratus/cli cache.all.clear
{"args":["Result: {\"Memcache cache clear\": \"Success\", \"CloudFront cache invalidation\": \"Success\", \"Redis cache clear\": \"Success\", \"Varnish cache clear\": \"Success\", \"OPCache cache clear\": \"Success\"}"]}
2019-03-11T16:20:07+0000 Main loop terminated.

See also Deploy To Stratus