Skip to content

Commit

Permalink
Merge pull request rubymem#23 from rubymem/fixes/bin-setup
Browse files Browse the repository at this point in the history
Fixes/bin setup
  • Loading branch information
bronzdoc authored Oct 29, 2019
2 parents cbc140d + d58024e commit 10c1b94
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
# Ignore bundler config.
/.bundle

# Ignore Ruby Version Manager File
.ruby-version

# Ignore Database Configuration File
config/database.yml

# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

1 change: 1 addition & 0 deletions .ruby-version.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.3
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ services:
- postgresql

before_script:
- cp config/database.yml.sample config/database.yml
- bundle exec rake db:create db:migrate

15 changes: 10 additions & 5 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,20 @@ chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file.

puts "\n== Copying sample files =="
unless File.exist?('config/database.yml')
cp 'config/database.yml.sample', 'config/database.yml'
end

unless File.exist?('.ruby-version')
cp '.ruby-version.sample', '.ruby-version'
system! 'cd .'
end

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

# puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml'
# end

puts "\n== Preparing database =="
system! 'bin/rails db:setup'

Expand Down
6 changes: 3 additions & 3 deletions config/database.yml → config/database.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ default: &default

development:
<<: *default
database: rubymem-dev
database: rubymem_dev

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: rubymem-test
database: rubymem_test

production:
<<: *default
user: rubymem
database: rubymem-prod
database: rubymem_prod

0 comments on commit 10c1b94

Please sign in to comment.