Skip to content

Fix setup script regarding database and school templates #928

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ autolab_setup() {
cp $AUTOLAB_PATH/config/database.yml.template $AUTOLAB_PATH/config/database.yml
sed -i "s/<username>/$USER/g" $AUTOLAB_PATH/config/database.yml

cp $AUTOLAB_PATH/config/school.yml.template $AUTOLAB_PATH/config/school.yml

cp $AUTOLAB_PATH/config/initializers/devise.rb.template $AUTOLAB_PATH/config/initializers/devise.rb
sed -i "s/<YOUR-SECRET-KEY>/`bundle exec rake secret`/g" $AUTOLAB_PATH/config/initializers/devise.rb

cp $AUTOLAB_PATH/config/autogradeConfig.rb.template $AUTOLAB_PATH/config/autogradeConfig.rb

cp $AUTOLAB_PATH/config/school.yml.template $AUTOLAB_PATH/config/school.yml

log "Granting MySQL database permissions..."
mysql -uroot -p$MYSQL_ROOT_PSWD -e "GRANT ALL PRIVILEGES ON ""$USER""_autolab_development.* TO '$USER'@'%' IDENTIFIED BY '<password>'"
Expand Down
28 changes: 14 additions & 14 deletions config/database.yml.template
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# MySQL Configuration
#development:
# adapter: mysql2
# database: <username>_autolab_development
# pool: 5
# username: <username>
# password: '<password>'
# socket: /var/run/mysqld/mysqld.sock
# host: localhost

SQLite Configuration
development:
adapter: sqlite3
database: db/db.sqlite3
pool: 5
timeout: 5000
adapter: mysql2
database: <username>_autolab_development
pool: 5
username: <username>
password: '<password>'
socket: /var/run/mysqld/mysqld.sock
host: localhost

# SQLite Configuration
# development:
# adapter: sqlite3
# database: db/db.sqlite3
# pool: 5
# timeout: 5000

test:
adapter: mysql2
Expand Down