Description:
added more instructions for installer
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r90:c62b55de9ac7 - - 1 file changed: 2 inserted, 1 deleted

@@ -40,102 +40,103
40 echo "1. Run mysql:"
40 echo "1. Run mysql:"
41 echo
41 echo
42 echo " mysql -u root -p"
42 echo " mysql -u root -p"
43 echo
43 echo
44 echo " if you have just installed mysql, the root password is the one that you have just entered"
44 echo " if you have just installed mysql, the root password is the one that you have just entered"
45 echo "2. Create a new database, a new user, and grant access to grader database:"
45 echo "2. Create a new database, a new user, and grant access to grader database:"
46 echo
46 echo
47 echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';"
47 echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';"
48 echo " create database DATABASENEME;"
48 echo " create database DATABASENEME;"
49 echo " grant all on DATABASENAME.* to 'USERNAME'@'localhost';"
49 echo " grant all on DATABASENAME.* to 'USERNAME'@'localhost';"
50 echo
50 echo
51 echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly."
51 echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly."
52 echo
52 echo
53 echo "Hit enter when ready..."
53 echo "Hit enter when ready..."
54 read dummy
54 read dummy
55 fi
55 fi
56
56
57 CAFE_PATH=`pwd`
57 CAFE_PATH=`pwd`
58
58
59 cd web
59 cd web
60
60
61 echo "Please provide grader database:"
61 echo "Please provide grader database:"
62 read database
62 read database
63
63
64 echo "Please provide grader username:"
64 echo "Please provide grader username:"
65 read username
65 read username
66
66
67 echo "Please provide $username password:"
67 echo "Please provide $username password:"
68 read password
68 read password
69
69
70 echo "development:" > config/database.yml
70 echo "development:" > config/database.yml
71 echo " adapter: mysql" >> config/database.yml
71 echo " adapter: mysql" >> config/database.yml
72 echo " database: $database" >> config/database.yml
72 echo " database: $database" >> config/database.yml
73 echo " username: $username" >> config/database.yml
73 echo " username: $username" >> config/database.yml
74 echo " password: $password" >> config/database.yml
74 echo " password: $password" >> config/database.yml
75 echo " host: localhost" >> config/database.yml
75 echo " host: localhost" >> config/database.yml
76 echo "" >> config/database.yml
76 echo "" >> config/database.yml
77 echo "production:" >> config/database.yml
77 echo "production:" >> config/database.yml
78 echo " adapter: mysql" >> config/database.yml
78 echo " adapter: mysql" >> config/database.yml
79 echo " database: $database" >> config/database.yml
79 echo " database: $database" >> config/database.yml
80 echo " username: $username" >> config/database.yml
80 echo " username: $username" >> config/database.yml
81 echo " password: $password" >> config/database.yml
81 echo " password: $password" >> config/database.yml
82 echo " host: localhost" >> config/database.yml
82 echo " host: localhost" >> config/database.yml
83
83
84 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
84 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
85 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
85 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
86 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
86 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
87 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
87 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
88
88
89 echo "Installing required gems"
89 echo "Installing required gems"
90
90
91 sudo rake gems:install
91 sudo rake gems:install
92 # to remove log file owned by root
92 # to remove log file owned by root
93 sudo rm log/*
93 sudo rm log/*
94 sudo rmdir log
94 sudo rmdir log
95
95
96 echo "Running rake tasks to initialize database"
96 echo "Running rake tasks to initialize database"
97
97
98 rake db:migrate
98 rake db:migrate
99 rake db:seed
99 rake db:seed
100
100
101 echo "Intalling web interface complete..."
101 echo "Intalling web interface complete..."
102 echo
102 echo
103 echo "Fetching grader"
103 echo "Fetching grader"
104
104
105 cd ..
105 cd ..
106
106
107 mkdir judge
107 mkdir judge
108 cd judge
108 cd judge
109 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
109 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
110 mkdir raw
110 mkdir raw
111 mkdir ev-exam
111 mkdir ev-exam
112 mkdir ev
112 mkdir ev
113 mkdir result
113 mkdir result
114 mkdir log
114 mkdir log
115
115
116 echo "Configuring grader"
116 echo "Configuring grader"
117
117
118 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
118 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
119 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
119 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
120
120
121 # create new environment.rb file
121 # create new environment.rb file
122 echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
122 echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
123 echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
123 echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
124 echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb
124 echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb
125 echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
125 echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
126
126
127 cd ..
127 cd ..
128
128
129 echo "Installing web server mongrel"
129 echo "Installing web server mongrel"
130
130
131 sudo gem install mongrel --no-ri --no-rdoc
131 sudo gem install mongrel --no-ri --no-rdoc
132
132
133 echo "Now you are ready to run cafe grader...."
133 echo "Now you are ready to run cafe grader...."
134 echo
134 echo
135 echo "Try:"
135 echo "Try:"
136 + echo
136 echo " cd web"
137 echo " cd web"
137 echo " ./script/server"
138 echo " ./script/server"
138 echo
139 echo
139 echo "and access web at http://localhost:3000/"
140 echo "and access web at http://localhost:3000/"
141 + echo "The root username is 'root', its password is 'ioionrails'."
140
142
141 -
You need to be logged in to leave comments. Login now