Description:
changed repo url to use git, thanks to nullzero
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r136:4489f3c36159 - - 1 file changed: 1 inserted, 1 deleted

@@ -1,118 +1,118
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 --version=2.3.8
15 15
16 16 echo "Fetching Cafe Grader from Git repositories"
17 17
18 18 echo "Fetching web interface"
19 19
20 20 mkdir cafe_grader
21 21 cd cafe_grader
22 - git clone -q http://git.gitorious.org/cafe-grader/cafe-grader-web.git web
22 + git clone -q git://gitorious.org/cafe-grader/cafe-grader-web.git web
23 23
24 24 echo "Configuring rails app"
25 25
26 26 cp web/config/environment.rb.SAMPLE web/config/environment.rb
27 27
28 28 echo "At this point we will need MySQL user and database."
29 29 echo "Have you created MySQL user and database for Cafe grader? (Y/N) "
30 30 read ch
31 31
32 32 if [ "$ch" = "n" -o "$ch" = "N" ]
33 33 then
34 34 echo "Please open another terminal and create the user and database for Cafe grader."
35 35 echo "Don't forget to grant access to that database for the user."
36 36 echo "Please have username, password, and database name ready before continue."
37 37 echo
38 38 echo "The following are instructions:"
39 39 echo "1. Run mysql:"
40 40 echo
41 41 echo " mysql -u root -p"
42 42 echo
43 43 echo " if you have just installed mysql, the root password is the one that you have just entered"
44 44 echo "2. Create a new database, a new user, and grant access to grader database:"
45 45 echo
46 46 echo " create user 'USERNAME'@'localhost' identified by 'PASSWORD';"
47 47 echo " create database \`DATABASENEME\`;"
48 48 echo " grant all on \`DATABASENAME\`.* to 'USERNAME'@'localhost';"
49 49 echo
50 50 echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly."
51 51 echo
52 52 echo "Hit enter when ready..."
53 53 read dummy
54 54 fi
55 55
56 56 CAFE_PATH=`pwd`
57 57
58 58 cd web
59 59
60 60 echo "Please provide grader database:"
61 61 read database
62 62
63 63 echo "Please provide grader username:"
64 64 read username
65 65
66 66 echo "Please provide $username password:"
67 67 read password
68 68
69 69 echo "development:" > config/database.yml
70 70 echo " adapter: mysql" >> config/database.yml
71 71 echo " database: $database" >> config/database.yml
72 72 echo " username: $username" >> config/database.yml
73 73 echo " password: $password" >> config/database.yml
74 74 echo " host: localhost" >> config/database.yml
75 75 echo "" >> config/database.yml
76 76 echo "production:" >> config/database.yml
77 77 echo " adapter: mysql" >> config/database.yml
78 78 echo " database: $database" >> config/database.yml
79 79 echo " username: $username" >> config/database.yml
80 80 echo " password: $password" >> config/database.yml
81 81 echo " host: localhost" >> config/database.yml
82 82
83 83 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/environment.rb
84 84 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/environment.rb
85 85 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/environment.rb
86 86 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/environment.rb
87 87
88 88 echo "Installing required gems"
89 89
90 90 sudo rake gems:install
91 91 # to remove log file owned by root
92 92 sudo rm log/*
93 93 sudo rmdir log
94 94
95 95 echo "Running rake tasks to initialize database"
96 96
97 97 rake db:migrate
98 98 rake db:seed
99 99
100 100 echo "Intalling web interface complete..."
101 101 echo
102 102 echo "Fetching grader"
103 103
104 104 cd ..
105 105
106 106 mkdir judge
107 107 cd judge
108 108 git clone -q http://git.gitorious.org/cafe-grader/cafe-grader-judge-scripts.git scripts
109 109 mkdir raw
110 110 mkdir ev-exam
111 111 mkdir ev
112 112 mkdir result
113 113 mkdir log
114 114
115 115 echo "Configuring grader"
116 116
117 117 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
118 118 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
You need to be logged in to leave comments. Login now