mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
chore: add documentation to rake commands
This commit is contained in:
parent
b96e0a57a9
commit
623dbe5e44
1 changed files with 27 additions and 14 deletions
|
|
@ -1,6 +1,15 @@
|
|||
require "csv"
|
||||
|
||||
namespace(:data) do
|
||||
# locally
|
||||
# bundle exec rake data:load_survey_responses
|
||||
|
||||
# on heroku staging environment
|
||||
# heroku run:detached -a mciea-beta bundle exec rake data:load_survey_responses
|
||||
|
||||
# on heroku production environment
|
||||
# heroku run:detached -a mciea-dashboard bundle exec rake data:load_survey_responses
|
||||
|
||||
desc("load survey responses")
|
||||
task(load_survey_responses: :environment) do
|
||||
survey_item_response_count = SurveyItemResponse.count
|
||||
|
|
@ -17,6 +26,17 @@ namespace(:data) do
|
|||
Rails.cache.clear
|
||||
end
|
||||
|
||||
# Usage:
|
||||
# SFTP_PATH=/data/survey_responses/clean/2022_23 bundle exec rake data:load_survey_responses_from_path
|
||||
# You can also swap the order of the commands and environment variables
|
||||
# bundle exec rake data:load_survey_responses_from_path SFTP_PATH=/ecp/data/survey_responses/clean/2024_25
|
||||
|
||||
# on heroku staging environment
|
||||
# heroku run:detached -a mciea-beta SFTP_PATH=/ecp/data/survey_responses/clean/2024_25 bundle exec rake data:load_survey_responses_from_path
|
||||
|
||||
# on heroku production environment
|
||||
# heroku run:detached -a mciea-dashboard SFTP_PATH=/ecp/data/survey_responses/clean/2024_25 bundle exec rake data:load_survey_responses_from_path
|
||||
|
||||
desc("load survey responses from a specific directory")
|
||||
task(load_survey_responses_from_path: :environment) do
|
||||
survey_item_response_count = SurveyItemResponse.count
|
||||
|
|
@ -33,21 +53,14 @@ namespace(:data) do
|
|||
Rails.cache.clear
|
||||
end
|
||||
|
||||
desc("reset response rate values")
|
||||
task(reset_response_rates: :environment) do
|
||||
puts("Resetting response rates")
|
||||
ResponseRateLoader.reset
|
||||
Rails.cache.clear
|
||||
puts("=====================> Completed loading #{ResponseRate.count} survey responses")
|
||||
end
|
||||
# locally
|
||||
# $ bundle exec rake data:load_admin_data
|
||||
|
||||
desc("reset race score calculations")
|
||||
task(reset_race_scores: :environment) do
|
||||
puts("Resetting race scores")
|
||||
RaceScoreLoader.reset(fast_processing: false)
|
||||
Rails.cache.clear
|
||||
puts("=====================> Completed loading #{RaceScore.count} survey responses")
|
||||
end
|
||||
# on heroku staging environment
|
||||
# $ heroku run:detached -a mciea-beta bundle exec rake data:load_admin_data
|
||||
|
||||
# on heroku production environment
|
||||
# $ heroku run:detached -a mciea-dashboard bundle exec rake data:load_admin_data
|
||||
|
||||
desc("load admin_data")
|
||||
task(load_admin_data: :environment) do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue