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

r88:692a33c93a20 - - 1 file changed: 3 inserted, 1 deleted

@@ -1,82 +1,84
1 #!/bin/sh
1 #!/bin/sh
2
2
3 echo "This script will install and configure Cafe grader."
3 echo "This script will install and configure Cafe grader."
4
4
5 echo "Installing required apt"
5 echo "Installing required apt"
6
6
7 + sudo apt-get update
7 sudo apt-get install mysql-server mysql-client ruby1.8 ruby1.8-dev rdoc1.8 \
8 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 \
9 g++ gcc libmysql-ruby1.8 irb apache2 libmysqlclient15-dev build-essential \
9 git-core rubygems rake openssl libopenssl-ruby
10 git-core rubygems rake openssl libopenssl-ruby
10
11
11 echo "Installing rails"
12 echo "Installing rails"
12
13
13 sudo gem install rails --no-ri --no-rdoc
14 sudo gem install rails --no-ri --no-rdoc
15 + sudo gem install rack -v=1.0.1 --no-ri --no-rdoc
14
16
15 echo "Fetching Cafe Grader from Git repositories"
17 echo "Fetching Cafe Grader from Git repositories"
16
18
17 echo "Fetching web interface"
19 echo "Fetching web interface"
18
20
19 mkdir cafe_grader
21 mkdir cafe_grader
20 cd cafe_grader
22 cd cafe_grader
21 git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
23 git clone http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
22
24
23 echo "Configuring rails app"
25 echo "Configuring rails app"
24
26
25 cp web/config/environment.rb.SAMPLE web/config/environment.rb
27 cp web/config/environment.rb.SAMPLE web/config/environment.rb
26
28
27 echo "At this point we will need MySQL user and database."
29 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) "
30 echo "Have you created MySQL user and database for Cafe grader? (Y/N) "
29 read ch
31 read ch
30
32
31 if [ "$ch" = "n" -o "$ch" = "N" ]
33 if [ "$ch" = "n" -o "$ch" = "N" ]
32 then
34 then
33 echo "Please open another terminal and create the user and database for Cafe grader."
35 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."
36 + echo "Don't forget to grant access to that database for the user."
35 echo "Please have username, password, and database name ready before continue."
37 echo "Please have username, password, and database name ready before continue."
36 echo "Hit enter when ready..."
38 echo "Hit enter when ready..."
37 read dummy
39 read dummy
38 fi
40 fi
39
41
40 CAFE_PATH=`pwd`
42 CAFE_PATH=`pwd`
41
43
42 cd web
44 cd web
43
45
44 echo "Please provide grader database:"
46 echo "Please provide grader database:"
45 read database
47 read database
46
48
47 echo "Please provide grader username:"
49 echo "Please provide grader username:"
48 read username
50 read username
49
51
50 echo "Please provide $username password:"
52 echo "Please provide $username password:"
51 read password
53 read password
52
54
53 echo "development:" > config/database.yml
55 echo "development:" > config/database.yml
54 echo " adapter: mysql" >> config/database.yml
56 echo " adapter: mysql" >> config/database.yml
55 echo " database: $database" >> config/database.yml
57 echo " database: $database" >> config/database.yml
56 echo " username: $username" >> config/database.yml
58 echo " username: $username" >> config/database.yml
57 echo " password: $password" >> config/database.yml
59 echo " password: $password" >> config/database.yml
58 echo " host: localhost" >> config/database.yml
60 echo " host: localhost" >> config/database.yml
59 echo "" >> config/database.yml
61 echo "" >> config/database.yml
60 echo "production:" >> config/database.yml
62 echo "production:" >> config/database.yml
61 echo " adapter: mysql" >> config/database.yml
63 echo " adapter: mysql" >> config/database.yml
62 echo " database: $database" >> config/database.yml
64 echo " database: $database" >> config/database.yml
63 echo " username: $username" >> config/database.yml
65 echo " username: $username" >> config/database.yml
64 echo " password: $password" >> config/database.yml
66 echo " password: $password" >> config/database.yml
65 echo " host: localhost" >> config/database.yml
67 echo " host: localhost" >> config/database.yml
66
68
67 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
69 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
70 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
69 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
71 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
70 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
72 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
71
73
72 echo "Installing required gems"
74 echo "Installing required gems"
73
75
74 sudo rake gems:install
76 sudo rake gems:install
75 # to remove log file owned by root
77 # to remove log file owned by root
76 sudo rm log/*
78 sudo rm log/*
77 sudo rmdir log
79 sudo rmdir log
78
80
79 echo "Running rake tasks to initialize database"
81 echo "Running rake tasks to initialize database"
80
82
81 rake db:migrate
83 rake db:migrate
82 rake db:seed
84 rake db:seed
You need to be logged in to leave comments. Login now