Description:
Update install.sh revert back to use single user rvm instead also fix the secret file generating script
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r267:a92e27ea4e22 - - 1 file changed: 15 inserted, 23 deleted

@@ -1,42 +1,36
1 #!/bin/sh
1 #!/bin/sh
2
2
3 #installation script for cafe-grader, for ubuntu 16.04
3 #installation script for cafe-grader, for ubuntu 16.04
4
4
5 echo "This script will install and configure Cafe grader."
5 echo "This script will install and configure Cafe grader."
6
6
7 RUBY_VERSION=2.3.4
7 RUBY_VERSION=2.3.4
8 echo "This will install Ruby $RUBY_VERSION under RVM"
8 echo "This will install Ruby $RUBY_VERSION under RVM"
9
9
10 echo "Installing required apts"
10 echo "Installing required apts"
11
11
12 - sudo apt-get install software-properties-common
13 - sudo apt-add-repository -y ppa:rael-gc/rvm
14 sudo apt-get update
12 sudo apt-get update
15 - sudo apt-get install rvm mysql-server mysql-client \
13 + sudo apt-get install mysql-server mysql-client \
16 g++ gcc apache2 libmysqlclient20 build-essential \
14 g++ gcc apache2 libmysqlclient20 build-essential \
17 git-core openssl libreadline6 libreadline6-dev \
15 git-core openssl libreadline6 libreadline6-dev \
18 zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev \
16 zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev \
19 sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev \
17 sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev \
20 ncurses-dev automake libtool bison subversion \
18 ncurses-dev automake libtool bison subversion \
21 pkg-config curl nodejs unzip pyflakes ruby default-jdk \
19 pkg-config curl nodejs unzip pyflakes ruby default-jdk \
22 libmysqld-dev mercurial python-setuptools python-dev python3-numpy
20 libmysqld-dev mercurial python-setuptools python-dev python3-numpy
23
21
24 - #--- edited --
22 + echo "Installing RVM"
25 - #--- we now use rvm from ubuntu package ---
23 + curl -k -L https://get.rvm.io | bash -s stable
26 - #echo "Installing RVM"
24 + source ~/.rvm/scripts/rvm
27 - #curl -k -L https://get.rvm.io | bash -s stable
28 - #source ~/.rvm/scripts/rvm
29 -
30 - source /etc/profile.d/rvm.sh
31
25
32 echo "Installing Ruby $RUBY_VERSION in RVM"
26 echo "Installing Ruby $RUBY_VERSION in RVM"
33
27
34 rvm install $RUBY_VERSION
28 rvm install $RUBY_VERSION
35 rvm use $RUBY_VERSION
29 rvm use $RUBY_VERSION
36
30
37 echo "Fetching Cafe Grader from Git repositories"
31 echo "Fetching Cafe Grader from Git repositories"
38
32
39 echo "Fetching web interface"
33 echo "Fetching web interface"
40
34
41 mkdir cafe_grader
35 mkdir cafe_grader
42 cd cafe_grader
36 cd cafe_grader
@@ -118,50 +112,48
118 echo " database: $database" >> config/database.yml
112 echo " database: $database" >> config/database.yml
119 echo " pool: 5" >> config/database.yml
113 echo " pool: 5" >> config/database.yml
120 echo " username: $username" >> config/database.yml
114 echo " username: $username" >> config/database.yml
121 echo " password: $password" >> config/database.yml
115 echo " password: $password" >> config/database.yml
122 echo " host: localhost" >> config/database.yml
116 echo " host: localhost" >> config/database.yml
123 echo " socket: /var/run/mysqld/mysqld.sock" >> config/database.yml
117 echo " socket: /var/run/mysqld/mysqld.sock" >> config/database.yml
124
118
125 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/initializers/cafe_grader_config.rb
119 echo "Object.instance_eval{remove_const :GRADER_ROOT_DIR}" >> config/initializers/cafe_grader_config.rb
126 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/initializers/cafe_grader_config.rb
120 echo "Object.instance_eval{remove_const :GRADING_RESULT_DIR}" >> config/initializers/cafe_grader_config.rb
127 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/initializers/cafe_grader_config.rb
121 echo "GRADER_ROOT_DIR = '$CAFE_PATH/judge'" >> config/initializers/cafe_grader_config.rb
128 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/initializers/cafe_grader_config.rb
122 echo "GRADING_RESULT_DIR = '$CAFE_PATH/judge/result'" >> config/initializers/cafe_grader_config.rb
129
123
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 -
143 echo "Installing required gems"
124 echo "Installing required gems"
144 gem install bundler
125 gem install bundler
145 bundle install
126 bundle install
146
127
147 echo "Running rake tasks to initialize database"
128 echo "Running rake tasks to initialize database"
148
129
149 rake db:migrate
130 rake db:migrate
150 rake db:seed
131 rake db:seed
151
132
152 echo "Running rake tasks to precompile the assets"
133 echo "Running rake tasks to precompile the assets"
153
134
154 rake assets:precompile
135 rake assets:precompile
155
136
137 + echo "setup the secret file"
138 + SECRET_A=`rake secret`
139 + SECRET_B=`rake secret`
140 + SECRET_C=`rake secret`
141 + echo "development:" > config/secrets.yml
142 + echo " secret_key_base: '$SECRET_A'" >> config/secrets.yml
143 + echo "test:" >> config/secrets.yml
144 + echo " secret_key_base: '$SECRET_B'" >> config/secrets.yml
145 + echo "production:" >> config/secrets.yml
146 + echo " secret_key_base: '$SECRET_C'" >> config/secrets.yml
147 +
156 echo "Intalling web interface complete..."
148 echo "Intalling web interface complete..."
157 echo
149 echo
158 echo "Fetching grader"
150 echo "Fetching grader"
159
151
160 cd ..
152 cd ..
161
153
162 mkdir judge
154 mkdir judge
163 cd judge
155 cd judge
164 git clone -q git://github.com/cafe-grader-team/cafe-grader-judge-scripts.git scripts
156 git clone -q git://github.com/cafe-grader-team/cafe-grader-judge-scripts.git scripts
165 mkdir raw
157 mkdir raw
166 mkdir ev-exam
158 mkdir ev-exam
167 mkdir ev
159 mkdir ev
You need to be logged in to leave comments. Login now