Description:
run rake db:seed after migration
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r87:8e9b4b13e4ad - - 1 file changed: 1 inserted, 0 deleted

@@ -34,90 +34,91
34 echo "Don't forget to grant access to that database fro the user."
34 echo "Don't forget to grant access to that database fro the user."
35 echo "Please have username, password, and database name ready before continue."
35 echo "Please have username, password, and database name ready before continue."
36 echo "Hit enter when ready..."
36 echo "Hit enter when ready..."
37 read dummy
37 read dummy
38 fi
38 fi
39
39
40 CAFE_PATH=`pwd`
40 CAFE_PATH=`pwd`
41
41
42 cd web
42 cd web
43
43
44 echo "Please provide grader database:"
44 echo "Please provide grader database:"
45 read database
45 read database
46
46
47 echo "Please provide grader username:"
47 echo "Please provide grader username:"
48 read username
48 read username
49
49
50 echo "Please provide $username password:"
50 echo "Please provide $username password:"
51 read password
51 read password
52
52
53 echo "development:" > config/database.yml
53 echo "development:" > config/database.yml
54 echo " adapter: mysql" >> config/database.yml
54 echo " adapter: mysql" >> config/database.yml
55 echo " database: $database" >> config/database.yml
55 echo " database: $database" >> config/database.yml
56 echo " username: $username" >> config/database.yml
56 echo " username: $username" >> config/database.yml
57 echo " password: $password" >> config/database.yml
57 echo " password: $password" >> config/database.yml
58 echo " host: localhost" >> config/database.yml
58 echo " host: localhost" >> config/database.yml
59 echo "" >> config/database.yml
59 echo "" >> config/database.yml
60 echo "production:" >> config/database.yml
60 echo "production:" >> config/database.yml
61 echo " adapter: mysql" >> config/database.yml
61 echo " adapter: mysql" >> config/database.yml
62 echo " database: $database" >> config/database.yml
62 echo " database: $database" >> config/database.yml
63 echo " username: $username" >> config/database.yml
63 echo " username: $username" >> config/database.yml
64 echo " password: $password" >> config/database.yml
64 echo " password: $password" >> config/database.yml
65 echo " host: localhost" >> config/database.yml
65 echo " host: localhost" >> config/database.yml
66
66
67 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
67 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
68 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
68 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
69 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
69 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
70 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
70 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
71
71
72 echo "Installing required gems"
72 echo "Installing required gems"
73
73
74 sudo rake gems:install
74 sudo rake gems:install
75 # to remove log file owned by root
75 # to remove log file owned by root
76 sudo rm log/*
76 sudo rm log/*
77 sudo rmdir log
77 sudo rmdir log
78
78
79 echo "Running rake tasks to initialize database"
79 echo "Running rake tasks to initialize database"
80
80
81 rake db:migrate
81 rake db:migrate
82 + rake db:seed
82
83
83 echo "Intalling web interface complete..."
84 echo "Intalling web interface complete..."
84 echo
85 echo
85 echo "Fetching grader"
86 echo "Fetching grader"
86
87
87 cd ..
88 cd ..
88
89
89 mkdir judge
90 mkdir judge
90 cd judge
91 cd judge
91 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
92 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
92 mkdir raw
93 mkdir raw
93 mkdir ev-exam
94 mkdir ev-exam
94 mkdir ev
95 mkdir ev
95 mkdir result
96 mkdir result
96 mkdir log
97 mkdir log
97
98
98 echo "Configuring grader"
99 echo "Configuring grader"
99
100
100 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
101 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
101 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
102 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
102
103
103 # create new environment.rb file
104 # create new environment.rb file
104 echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
105 echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
105 echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
106 echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
106 echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb
107 echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb
107 echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
108 echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
108
109
109 cd ..
110 cd ..
110
111
111 echo "Installing web server mongrel"
112 echo "Installing web server mongrel"
112
113
113 sudo gem install mongrel --no-ri --no-rdoc
114 sudo gem install mongrel --no-ri --no-rdoc
114
115
115 echo "Now you are ready to run cafe grader...."
116 echo "Now you are ready to run cafe grader...."
116 echo
117 echo
117 echo "Try:"
118 echo "Try:"
118 echo " cd web"
119 echo " cd web"
119 echo " ./script/server"
120 echo " ./script/server"
120 echo
121 echo
121 echo "and access web at http://localhost:3000/"
122 echo "and access web at http://localhost:3000/"
122
123
123
124
You need to be logged in to leave comments. Login now