Forked from tsergium/alice&bob_usefull_commands
Last active
November 25, 2015 11:34
-
-
Save sorinstanila/7627686c03763dd09d90 to your computer and use it in GitHub Desktop.
Alice & Bob&Chuck Usefull Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Chuck | |
========== | |
* Run migrations: | |
php application/cli.php intcart_dev dev admin migration execute | |
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) | |
sudo -u www-data php /var/www/intcart/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 | |
* remove the cache | |
sudo rm -rf alice/tmp/configcache/* alice/tmp/core/* | |
* 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