With the Spryker Commerce OS comes an all-inclusive and fully pre-provisioned development environment on a virtual machine, based on Vagrant and VirtualBox.
The command-line Console tool enables you to execute a great variety of commands, such as managing the Spryker Commerce OS installer, to run the OS in any environment.
A console command is a php class that contains the implementation of a functionality that can get executed from the command line. Spryker contains a wrapper over Symfony’s Console component, that makes the implementation and configuration of a console command easier. More information about console commands in Spryker can be found here.
Console Commands in Spryker
To list the available console commands, execute the following from the command line:
The list contains the command names together with a short description of what the command does. The most important commands in Spryker can be split in 3 categories :
Collector commands are responsible of exporting the data in the SQL database to the front-end data storages (Redis and Elasticsearch)
- collector:search:export - exports data to the Elasticsearch storage
- collector:search:update - updates the data in the Elasticsearch storage
- collector:storage:export - exports data to Key-Value storage (Redis)
- oms:check-condition - check if conditions are satisfied for orders that are in a state that is the source state for a transition that has a condition attached
- oms:check-timeout - check if timeout was reached for orders that are in a state that is the source state for a transition that has a timeout attached
setup:install - runs a set of commands, necessary for installing or updating the application. The following steps are performed when running this command:
- delete all cache files for all stores (cache:delete-all)
- remove the directory that contains the generated files, such as transfer classes, merged database schema XML files or autocompletion classes (setup:remove-generated-directory)
- create or migrate the database (setup:propel)
- generate transfer classes for each of the objects defined in the XML transfer files (transfer:generate)
- initialize the database with required data (setup:init-db)
- generate ide auto-completion files to enable navigation to referenced classes (dev:ide:generate-auto-completion). Generated auto-completion classes will be found for each application under the generated folder.
- build the project resources for Yves and Zed
- build the navigation tree (application:build-navigation-tree)
Each of the commands contained in the steps above can also be executed individually.
setup:install:demo-data - inserts demo data into the database for testing reasons
setup:propel - runs a set of commands, necessary for creating or migrating the database. The following steps are performed when running this command:
- write propel configuration (setup:propel:config:convert)
- creates the database if it doesn’t exist yet, based on the configuration set in the previous step (setup:propel:database:create)
- ensure compatibility with Postgresql if necessary, by adjusting the Propel XML schema files (setup:propel:pg-sql-compat)
- copy schema files from Spryker and project packages to the generated folder (setup:propel:schema:copy)
- build Propel classes based on the XML schema files (setup:propel:model:build)
- compare the propel models with the database tables and generate the diff, in order to prepare for migration (setup:propel:diff)
- migrate the database: update the database so that’s in sync with the propel models in the project (setup:propel:migrate)
Cron jobs are scheduled by using Jenkins. For setting up Jenkins, the following console commands can be used from the command line:
- scheduler:resume- starts the Jenkins service
- scheduler:suspend - shut downs the Jenkins service
- scheduler:setup- sets up the cron jobs based on the definitions contained in the configuration file ( the config file for jobs is placed in /config/Zed/cronjobs/jobs.php)
- scheduler:clean - cleans Jenkins jobs
Git commands are enabled through console commands and they have effect over the Spryker packages.