RAILS_ENV=production rake db:drop; RAILS_ENV=production rake db:create ; RAILS_ENV=production rake db:migrate ; RAILS_ENV=production rake db:seed
# Installing elasticsearch to run locally: www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-on-an-ubuntu-vps # Creating the elasticsearch index:
1. Delete current index: User.index.delete 2. Create index: User.create_elasticsearch_index 3. Import user's data: User.index.import User.all
# Do you want to use members search page locally? Use the following command to start solr sudo service elasticsearch start Use the following command to stop solr sudo service elasticsearch stop
Use the following command to add/update member records if DJ is not running on your dev env. rake environment tire:import CLASS=‘User’ FORCE=true
# Do you want to run run integration tests locally? Use the following command to start solr: RAILS_ENV=test rake sunspot:solr:start Use the following command to stop solr RAILS_ENV=test rake sunspot:solr:stop
# Generating SSL certificates with letsencrypt for CS and checkout subdomains in Production sudo ufw allow 80 certbot-auto certonly -a webroot –webroot-path=/var/www/sac-platform/current/public -d cs.affinitystop.com -d api.affinitystop.com -d checkout.onmc.com -d checkout.stockcarracefans.com sudo ufw deny 80
rails-erd.rubyforge.org/install.html sudo aptitude install graphviz
Generate Model rake erd rake assets:precompile
In order to create the doc you must run: you will have to use the binnary field within the bundler: /home/XXXXXXXX/.rvm/gems/ruby-1.9.3-p327/bundler/gems/yard-eb31004f1306/bin/yardoc –plugin rest –title “Api Documentation” –readme readme_api_doc.rdoc
# How to put and remove Phoenix into mantainance mode:
- Option 1
-
start: cap prototype|staging|production deploy:enable_maintenance_mode
-
end: cap prototype|staging|production deploy:disable_maintenance_mode
-
- Option 2
-
start: touch tmp/maintenance_on
-
end: rm tmp/maintenance_on
-
while in mantainance mode, API and Web will not be reachable. In order to update the db/declinestrategies.yml file, run: rake db:data:dump MODEL=DeclineStrategy After that make sure to replace: “- !ruby/ActiveRecord:DeclineStrategy” with “- !ruby/object:DeclineStrategy”
# Queues for Delayed Jobs
-
club_cash_queue: Queue with jobs related to Club Cash (reset_club_cash, assign_club_cash and add_club_cash methods)
-
email_queue: Queue for email jobs. Used in communication (deliver_action_mailer), fulfillment_file (send_email_with_file) and member models (send_active_needs_approval_email_dj & send_recover_needs_approval_email_dj).
-
exact_target_email: Used in communication model in method deliver_exact_target.
-
exact_target_sync: Used to handle delayed jobs related to ET sync.
-
mailchimp_sync: Used to handle delayed jobs related to Mailchimp sync.
-
mandrill_email: Used in communication model in method deliver_mandrill.
-
drupal_queue: Currently used for cancel_member_at_remote_domain method in member model.
-
generic_queue: To handle asorted delayed jobs.
-
elasticsearch_indexing: Indexing User’s iformation with elasticsearch.
-
lyris_email: Not used anymore since we currently don’t use Lyris.