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 5 echo "Installing required apt"
6 6
7 7 sudo apt-get install mysql-server mysql-client ruby1.8 ruby1.8-dev rdoc1.8 \
8 8 g++ gcc libmysql-ruby1.8 irb apache2 libmysqlclient15-dev build-essential \
9 9 git-core rubygems rake openssl libopenssl-ruby
10 10
11 11 echo "Installing rails"
12 12
13 13 sudo gem install rails --no-ri --no-rdoc
14 14
15 15 echo "Fetching Cafe Grader from Git repositories"
16 16
17 17 echo "Fetching web interface"
18 18
19 19 mkdir cafe_grader
20 20 cd cafe_grader
21 21 git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
22 22
23 23 echo "Configuring rails app"
24 24
25 25 cp web/config/environment.rb.SAMPLE web/config/environment.rb
26 26
27 27 echo "At this point we will need MySQL user and database."
28 28 echo "Have you created MySQL user and database for Cafe grader? (Y/N) "
29 29 read ch
30 30
31 31 if [ "$ch" = "n" -o "$ch" = "N" ]
32 32 then
33 33 echo "Please open another terminal and create the user and database for Cafe grader."
34 34 echo "Don't forget to grant access to that database fro the user."
35 35 echo "Please have username, password, and database name ready before continue."
36 36 echo "Hit enter when ready..."
37 37 read dummy
38 38 fi
39 39
40 40 CAFE_PATH=`pwd`
41 41
42 42 cd web
43 43
44 44 echo "Please provide grader database:"
45 45 read database
46 46
47 47 echo "Please provide grader username:"
48 48 read username
49 49
50 50 echo "Please provide $username password:"
51 51 read password
52 52
53 53 echo "development:" > config/database.yml
54 54 echo " adapter: mysql" >> config/database.yml
55 55 echo " database: $database" >> config/database.yml
56 56 echo " username: $username" >> config/database.yml
57 57 echo " password: $password" >> config/database.yml
58 58 echo " host: localhost" >> config/database.yml
59 59 echo "" >> config/database.yml
60 60 echo "production:" >> config/database.yml
61 61 echo " adapter: mysql" >> config/database.yml
62 62 echo " database: $database" >> config/database.yml
63 63 echo " username: $username" >> config/database.yml
64 64 echo " password: $password" >> config/database.yml
65 65 echo " host: localhost" >> config/database.yml
66 66
67 67 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
68 68 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
69 69 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
70 70 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
71 71
72 72 echo "Installing required gems"
73 73
74 74 sudo rake gems:install
75 75 # to remove log file owned by root
76 76 sudo rm log/*
77 77 sudo rmdir log
78 78
79 79 echo "Running rake tasks to initialize database"
80 80
81 81 rake db:migrate
82 82
83 83 echo "Intalling web interface complete..."
84 84 echo
85 85 echo "Fetching grader"
86 86
87 87 cd ..
88 88
89 89 mkdir judge
90 90 cd judge
91 91 git clone http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
92 92 mkdir raw
93 93 mkdir ev-exam
94 94 mkdir ev
95 95 mkdir result
96 96 mkdir log
97 97
98 98 echo "Configuring grader"
99 99
100 - cp scripts/config/environment.rb.SAMPLE scripts/config/environment.rb
101 100 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
102 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
105 - echo "RAILS_ROOT = '$CAFE_PATH/web'" >> scripts/config/environment.rb
106 - echo "Object.instance_eval{ remove_const :GRADER_ROOT }" >> scripts/config/environment.rb
107 - echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts" >> scripts/config/environment.rb
103 + # create new environment.rb file
104 + echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
105 + 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 109 cd ..
110 110
111 111 echo "Installing web server mongrel"
112 112
113 113 sudo gem install mongrel --no-ri --no-rdoc
114 114
115 115 echo "Now you are ready to run cafe grader...."
116 116 echo
117 117 echo "Try:"
118 118 echo " cd web"
119 119 echo " ./script/server"
120 120 echo
121 121 echo "and access web at http://localhost:3000/"
122 122
123 123
You need to be logged in to leave comments. Login now