Description:
fixed error in install script
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r85:3391db581cbc - - 1 file changed: 5 inserted, 5 deleted

@@ -4,120 +4,120
4
4
5 echo "Installing required apt"
5 echo "Installing required apt"
6
6
7 sudo apt-get install mysql-server mysql-client ruby1.8 ruby1.8-dev rdoc1.8 \
7 sudo apt-get install mysql-server mysql-client ruby1.8 ruby1.8-dev rdoc1.8 \
8 g++ gcc libmysql-ruby1.8 irb apache2 libmysqlclient15-dev build-essential \
8 g++ gcc libmysql-ruby1.8 irb apache2 libmysqlclient15-dev build-essential \
9 git-core rubygems rake openssl libopenssl-ruby
9 git-core rubygems rake openssl libopenssl-ruby
10
10
11 echo "Installing rails"
11 echo "Installing rails"
12
12
13 sudo gem install rails --no-ri --no-rdoc
13 sudo gem install rails --no-ri --no-rdoc
14
14
15 echo "Fetching Cafe Grader from Git repositories"
15 echo "Fetching Cafe Grader from Git repositories"
16
16
17 echo "Fetching web interface"
17 echo "Fetching web interface"
18
18
19 mkdir cafe_grader
19 mkdir cafe_grader
20 cd cafe_grader
20 cd cafe_grader
21 git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
21 git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
22
22
23 echo "Configuring rails app"
23 echo "Configuring rails app"
24
24
25 cp web/config/environment.rb.SAMPLE web/config/environment.rb
25 cp web/config/environment.rb.SAMPLE web/config/environment.rb
26
26
27 echo "At this point we will need MySQL user and database."
27 echo "At this point we will need MySQL user and database."
28 echo "Have you created MySQL user and database for Cafe grader? (Y/N) "
28 echo "Have you created MySQL user and database for Cafe grader? (Y/N) "
29 read ch
29 read ch
30
30
31 if [ "$ch" = "n" -o "$ch" = "N" ]
31 if [ "$ch" = "n" -o "$ch" = "N" ]
32 then
32 then
33 echo "Please open another terminal and create the user and database for Cafe grader."
33 echo "Please open another terminal and create the user and database for Cafe grader."
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
82
83 echo "Intalling web interface complete..."
83 echo "Intalling web interface complete..."
84 echo
84 echo
85 echo "Fetching grader"
85 echo "Fetching grader"
86
86
87 cd ..
87 cd ..
88
88
89 mkdir judge
89 mkdir judge
90 cd judge
90 cd judge
91 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
91 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
92 mkdir raw
92 mkdir raw
93 mkdir ev-exam
93 mkdir ev-exam
94 mkdir ev
94 mkdir ev
95 mkdir result
95 mkdir result
96 mkdir log
96 mkdir log
97
97
98 echo "Configuring grader"
98 echo "Configuring grader"
99
99
100 - cp scripts/config/environment.rb.SAMPLE scripts/config/environment.rb
101 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
100 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
102 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
101 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
103
102
104 - echo "Object.instance_eval{ remove_const :RAILS_ROOT }" >> scripts/config/environment.rb
103 + # create new environment.rb file
105 - echo "RAILS_ROOT = '$CAFE_PATH/web'" >> scripts/config/environment.rb
104 + echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
106 - echo "Object.instance_eval{ remove_const :GRADER_ROOT }" >> scripts/config/environment.rb
105 + echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
107 - 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.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
108
108
109 cd ..
109 cd ..
110
110
111 echo "Installing web server mongrel"
111 echo "Installing web server mongrel"
112
112
113 sudo gem install mongrel --no-ri --no-rdoc
113 sudo gem install mongrel --no-ri --no-rdoc
114
114
115 echo "Now you are ready to run cafe grader...."
115 echo "Now you are ready to run cafe grader...."
116 echo
116 echo
117 echo "Try:"
117 echo "Try:"
118 echo " cd web"
118 echo " cd web"
119 echo " ./script/server"
119 echo " ./script/server"
120 echo
120 echo
121 echo "and access web at http://localhost:3000/"
121 echo "and access web at http://localhost:3000/"
122
122
123
123
You need to be logged in to leave comments. Login now