Description:
updated to rails 2.3.8 by removing dependence on rack 1.0.1, be quiet when fetching git repos
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r134:e76da497dd2a - - 1 file changed: 2 inserted, 3 deleted
@@ -1,47 +1,46 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "This script will install and configure Cafe grader." |
|
4 | 4 | |
|
5 | 5 | echo "Installing required apt" |
|
6 | 6 | |
|
7 | 7 | sudo apt-get update |
|
8 | 8 | sudo apt-get install mysql-server mysql-client ruby1.8 ruby1.8-dev rdoc1.8 \ |
|
9 | 9 | g++ gcc libmysql-ruby1.8 irb apache2 libmysqlclient15-dev build-essential \ |
|
10 | 10 | git-core rubygems rake openssl libopenssl-ruby |
|
11 | 11 | |
|
12 | 12 | echo "Installing rails" |
|
13 | 13 | |
|
14 | 14 | sudo gem install rails --no-ri --no-rdoc |
|
15 | - sudo gem install rack -v=1.0.1 --no-ri --no-rdoc | |
|
16 | 15 | |
|
17 | 16 | echo "Fetching Cafe Grader from Git repositories" |
|
18 | 17 | |
|
19 | 18 | echo "Fetching web interface" |
|
20 | 19 | |
|
21 | 20 | mkdir cafe_grader |
|
22 | 21 | cd cafe_grader |
|
23 | - git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web | |
|
22 | + git clone -q http://git.gitorious.org/cafe-grader/cafe-grader-web.git web | |
|
24 | 23 | |
|
25 | 24 | echo "Configuring rails app" |
|
26 | 25 | |
|
27 | 26 | cp web/config/environment.rb.SAMPLE web/config/environment.rb |
|
28 | 27 | |
|
29 | 28 | echo "At this point we will need MySQL user and database." |
|
30 | 29 | echo "Have you created MySQL user and database for Cafe grader? (Y/N) " |
|
31 | 30 | read ch |
|
32 | 31 | |
|
33 | 32 | if [ "$ch" = "n" -o "$ch" = "N" ] |
|
34 | 33 | then |
|
35 | 34 | echo "Please open another terminal and create the user and database for Cafe grader." |
|
36 | 35 | echo "Don't forget to grant access to that database for the user." |
|
37 | 36 | echo "Please have username, password, and database name ready before continue." |
|
38 | 37 | echo |
|
39 | 38 | echo "The following are instructions:" |
|
40 | 39 | echo "1. Run mysql:" |
|
41 | 40 | echo |
|
42 | 41 | echo " mysql -u root -p" |
|
43 | 42 | echo |
|
44 | 43 | echo " if you have just installed mysql, the root password is the one that you have just entered" |
|
45 | 44 | echo "2. Create a new database, a new user, and grant access to grader database:" |
|
46 | 45 | echo |
|
47 | 46 | echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';" |
@@ -85,49 +84,49 | |||
|
85 | 84 | echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb |
|
86 | 85 | echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb |
|
87 | 86 | echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb |
|
88 | 87 | |
|
89 | 88 | echo "Installing required gems" |
|
90 | 89 | |
|
91 | 90 | sudo rake gems:install |
|
92 | 91 | # to remove log file owned by root |
|
93 | 92 | sudo rm log/* |
|
94 | 93 | sudo rmdir log |
|
95 | 94 | |
|
96 | 95 | echo "Running rake tasks to initialize database" |
|
97 | 96 | |
|
98 | 97 | rake db:migrate |
|
99 | 98 | rake db:seed |
|
100 | 99 | |
|
101 | 100 | echo "Intalling web interface complete..." |
|
102 | 101 | echo |
|
103 | 102 | echo "Fetching grader" |
|
104 | 103 | |
|
105 | 104 | cd .. |
|
106 | 105 | |
|
107 | 106 | mkdir judge |
|
108 | 107 | cd judge |
|
109 | - git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts | |
|
108 | + git clone -q http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts | |
|
110 | 109 | mkdir raw |
|
111 | 110 | mkdir ev-exam |
|
112 | 111 | mkdir ev |
|
113 | 112 | mkdir result |
|
114 | 113 | mkdir log |
|
115 | 114 | |
|
116 | 115 | echo "Configuring grader" |
|
117 | 116 | |
|
118 | 117 | cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb |
|
119 | 118 | cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb |
|
120 | 119 | |
|
121 | 120 | # create new environment.rb file |
|
122 | 121 | echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb |
|
123 | 122 | echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb |
|
124 | 123 | echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb |
|
125 | 124 | echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb |
|
126 | 125 | |
|
127 | 126 | cd .. |
|
128 | 127 | |
|
129 | 128 | echo "Installing web server mongrel" |
|
130 | 129 | |
|
131 | 130 | sudo gem install mongrel --no-ri --no-rdoc |
|
132 | 131 | |
|
133 | 132 | echo "Now you are ready to run cafe grader...." |
You need to be logged in to leave comments.
Login now