forked from cufcq/cufcq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
total_reload.sh
executable file
·48 lines (39 loc) · 1.08 KB
/
total_reload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#kill solr process
pkill -f solr
#remove old data
rm -rf solr/data
rm -rf solr/default
rm -rf solr/development
rm -rf solr/pids
rm -rf solr/test
while getopts 'pdt' flag; do
case "${flag}" in
d) export RAILS_ENV=development ;;
p) export RAILS_ENV=production ;;
t) export RAILS_ENV=test ;;
*) error "Unexpected option ${flag}" ;;
esac
done
#startup solr
bundle exec rake sunspot:solr:start
#all of our rake tasks
bundle exec rake db:create
bundle exec rake db:reset
bundle exec rake db:migrate
bundle exec rake departments
bundle exec rake import
bundle exec rake course_titles
bundle exec rake ic_relations
bundle exec rake grades
# build the hstore for departments
bundle exec rake instructor_build_hstore
bundle exec rake course_build_hstore
bundle exec rake department_build_hstore
# remove unnecesarry departments
bundle exec rake department_correction
# these rake tasks make slight corrections to the dataset. They should run pretty darn fast
bundle exec rake course_names
bundle exec rake course_missing_hstore
#reindex solr
bundle exec rake sunspot:solr:reindex