Description:
update install.sh to work with latest ubuntu LTS
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r266:88b545da976a - - 1 file changed: 13 inserted, 0 deleted

@@ -82,96 +82,109
82 82 echo " grant all on \`DATABASENAME\`.* to 'USERNAME'@'localhost';"
83 83 echo
84 84 echo " Replace USERNAME, PASSWORD, and DATABASENAME accordingly."
85 85 echo
86 86 echo "Hit enter when ready..."
87 87 read dummy
88 88 fi
89 89
90 90 CAFE_PATH=`pwd`
91 91
92 92 cd web
93 93
94 94 echo "Please provide grader database:"
95 95 read database
96 96
97 97 echo "Please provide grader username:"
98 98 read username
99 99
100 100 echo "Please provide $username password:"
101 101 read password
102 102
103 103 echo "development:" > config/database.yml
104 104 echo " adapter: mysql2" >> config/database.yml
105 105 echo " encoding: utf8" >> config/database.yml
106 106 echo " reconnect: false" >> config/database.yml
107 107 echo " database: $database" >> config/database.yml
108 108 echo " pool: 5" >> config/database.yml
109 109 echo " username: $username" >> config/database.yml
110 110 echo " password: $password" >> config/database.yml
111 111 echo " host: localhost" >> config/database.yml
112 112 echo " socket: /var/run/mysqld/mysqld.sock" >> config/database.yml
113 113 echo "" >> config/database.yml
114 114 echo "production:" >> config/database.yml
115 115 echo " adapter: mysql2" >> config/database.yml
116 116 echo " encoding: utf8" >> config/database.yml
117 117 echo " reconnect: false" >> config/database.yml
118 118 echo " database: $database" >> config/database.yml
119 119 echo " pool: 5" >> config/database.yml
120 120 echo " username: $username" >> config/database.yml
121 121 echo " password: $password" >> config/database.yml
122 122 echo " host: localhost" >> config/database.yml
123 123 echo " socket: /var/run/mysqld/mysqld.sock" >> config/database.yml
124 124
125 125 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/initializers/cafe_grader_config.rb
126 126 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/initializers/cafe_grader_config.rb
127 127 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/initializers/cafe_grader_config.rb
128 128 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/initializers/cafe_grader_config.rb
129 129
130 + # setup secret file
131 + SECRET_A=`rake secret`
132 + SECRET_B=`rake secret`
133 + SECRET_C=`rake secret`
134 + echo "development:" > config/secrets.yml
135 + echo " secret_key_base: '$SECRET_A'" >> config/secrets.yml
136 + echo "test:" >> config/secrets.yml
137 + echo " secret_key_base: '$SECRET_B'" >> config/secrets.yml
138 + echo "production:" >> config/secrets.yml
139 + echo " secret_key_base: '$SECRET_C'" >> config/secrets.yml
140 +
141 +
142 +
130 143 echo "Installing required gems"
131 144 gem install bundler
132 145 bundle install
133 146
134 147 echo "Running rake tasks to initialize database"
135 148
136 149 rake db:migrate
137 150 rake db:seed
138 151
139 152 echo "Running rake tasks to precompile the assets"
140 153
141 154 rake assets:precompile
142 155
143 156 echo "Intalling web interface complete..."
144 157 echo
145 158 echo "Fetching grader"
146 159
147 160 cd ..
148 161
149 162 mkdir judge
150 163 cd judge
151 164 git clone -q git://github.com/cafe-grader-team/cafe-grader-judge-scripts.git scripts
152 165 mkdir raw
153 166 mkdir ev-exam
154 167 mkdir ev
155 168 mkdir result
156 169 mkdir log
157 170
158 171 echo "Configuring grader"
159 172
160 173 cp scripts/config/env_exam.rb.SAMPLE scripts/config/env_exam.rb
161 174 cp scripts/config/env_grading.rb.SAMPLE scripts/config/env_grading.rb
162 175
163 176 # create new environment.rb file
164 177 echo "RAILS_ROOT = '$CAFE_PATH/web'" > scripts/config/environment.rb
165 178 echo "GRADER_ROOT = '$CAFE_PATH/judge/scripts'" >> scripts/config/environment.rb
166 179 echo "require File.join(File.dirname(__FILE__),'../lib/boot')" >> scripts/config/environment.rb
167 180 echo "require File.dirname(__FILE__) + \"/env_#{GRADER_ENV}.rb\"" >> scripts/config/environment.rb
168 181
169 182 # compiling box
170 183 MACHINE_TYPE=`uname -m`
171 184 if [ ${MACHINE_TYPE} == 'x86_64' ]; then
172 185 gcc -std=c99 -o scripts/std-script/box scripts/std-script/box64-new.c
173 186 else
174 187 g++ -o scripts/std-script/box scripts/std-script/box.cc
175 188 fi
176 189
177 190
You need to be logged in to leave comments. Login now