Skip to content

Instantly share code, notes, and snippets.

@tsergium
Created November 3, 2015 09:55
Show Gist options
  • Save tsergium/30fdc529cb0ac82d0514 to your computer and use it in GitHub Desktop.
Save tsergium/30fdc529cb0ac82d0514 to your computer and use it in GitHub Desktop.
Alice & Bob Usefull Commands
Alice & Bob Usefull Commands
==========
powered by Alice + Bob 2015
## What you need to do after git pull:
all commands are to be executed from project root as developer
1. stop queue consumers
php vendor/queue/starter.php --shutdown
2. regenerate classmaps, configs etc.. (if new classes were added or config was changed)
php tools/generate_all.php
3. run migrations (if migrations.php was changed)
php bob/cli/index.php --env=dev --m=maintenance --c=schema-updater
4. restart queue consumers
php -d memory_limit=1G vendor/queue/starter.php --env=dev --role=alice,bob --verbose
## If you want to start over again:
1. recreate database schema
mysql -uroot -e "DROP schema shop; CREATE schema shop;"
php bob/cli/index.php --env=dev --m=maintenance --c=schema-updater
2. load product dump (optional)
mysql -uroot shop < some_dump.sql
3. export bob configuration to database
php bob/cli/index.php --env=dev --m=maintenance --c=configuration --a=update-config
4. init full import for Alice + Solr (message queue must be running)
php tools/init-full-import.php --all --env=dev
## Other useful commands
* start Solr (must be done as root)
su; cd /var/www/shop/solr/jetty
java -jar start.jar
* monitor Solr
browse to http://solr:8080/#/
* monitor RabbitMQ message queue
browse to http://192.168.56.101:15672/#/queues, login with guest - guest
* grant access rights for data + temp folders
sudo chmod -R 777 bob/data/ alice/tmp/ conny/data/ data/
* compress JS + CSS for Alice (not to be committed)
php alice/dev/deploy.php
* make Alice use compressed JS + CSS files
change use.combined_static_files to "true" in alice/vendor/config/dev.ini
php tools/alice/generate_config_file.php
* reset Bob's config cache
rm -rf bob/data/cache/zend_cache---*
* create docblocks for Transfer Objects
php bob/cli/index.php --env=dev --m=maintenance --c=metadata-generator --a=transfer --scope=local
* create DbTable classes
php bob/cli/index.php --env=dev --m=maintenance --c=schema-updater --a=dbtable
* restart PHP
sudo service php5-fpm restart
* restart web server
sudo service nginx restart
* run tests
+ Alice:
1. copy the config file (initial setup)
$ cp alice/vendor/config/_testing.ini alice/vendor/config/testing.ini
2. create database schema (initial setup)
$ mysql -uroot -e 'CREATE SCHEMA shop_alice_test'
3. import test data (initial setup)
$ mysql -uroot shop_alice_test < alice/vendor/tests/data/sql/keyvalue.sql
4. re-generate the config file
$ php tools/alice/generate_config_file.php
5. run the tests
$ cd alice/vendor/tests/unit; phpunit AliceTest/
+ Bob unit:
$ cd bob/application/vendor/tests/unit; phpunit
+ Bob integration:
1. copy the config file (initial setup)
$ cp bob/application/vendor/configs/_automatedtests.ini bob/application/vendor/configs/automatedtests.ini
2. create database schema (initial setup)
$ mysql -uroot -e 'CREATE SCHEMA shop_test'
3. run the schema updater
$ php bob/cli/index.php --env=automatedtests --module=maintenance --controller=schema-updater
4. run the tests
$ cd bob/application/vendor/tests/integration; phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment