Simplify development environment setup
Rails provides a script that already did most of the steps.
This commit is contained in:
@@ -43,13 +43,8 @@ Prerequisites: install git, Ruby 3.1.4, CMake, pkg-config, shared-mime-info, Nod
|
||||
```bash
|
||||
git clone https://github.com/consuldemocracy/consuldemocracy.git
|
||||
cd consuldemocracy
|
||||
bundle install
|
||||
cp config/database.yml.example config/database.yml
|
||||
cp config/secrets.yml.example config/secrets.yml
|
||||
bin/rake db:create
|
||||
bin/rake db:migrate
|
||||
bin/setup
|
||||
bin/rake db:dev_seed
|
||||
RAILS_ENV=test rake db:setup
|
||||
```
|
||||
|
||||
Run the app locally:
|
||||
|
||||
@@ -41,13 +41,8 @@ Prerequisitos: tener instalado git, Ruby 3.1.4, CMake, pkg-config, shared-mime-i
|
||||
```bash
|
||||
git clone https://github.com/consuldemocracy/consuldemocracy.git
|
||||
cd consuldemocracy
|
||||
bundle install
|
||||
cp config/database.yml.example config/database.yml
|
||||
cp config/secrets.yml.example config/secrets.yml
|
||||
bin/rake db:create
|
||||
bin/rake db:migrate
|
||||
bin/setup
|
||||
bin/rake db:dev_seed
|
||||
RAILS_ENV=test rake db:setup
|
||||
```
|
||||
|
||||
Para ejecutar la aplicación en local:
|
||||
|
||||
13
bin/setup
13
bin/setup
@@ -17,13 +17,18 @@ FileUtils.chdir APP_ROOT do
|
||||
system! "gem install bundler --conservative"
|
||||
system("bundle check") || system!("bundle install")
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
# unless File.exist?('config/database.yml')
|
||||
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
|
||||
# end
|
||||
puts "\n== Copying sample files =="
|
||||
unless File.exist?("config/database.yml")
|
||||
FileUtils.cp "config/database.yml.example", "config/database.yml"
|
||||
end
|
||||
|
||||
unless File.exist?("config/secrets.yml")
|
||||
FileUtils.cp "config/secrets.yml.example", "config/secrets.yml"
|
||||
end
|
||||
|
||||
puts "\n== Preparing database =="
|
||||
system! "bin/rails db:prepare"
|
||||
system! "RAILS_ENV=test bin/rails db:prepare"
|
||||
|
||||
puts "\n== Removing old logs and tempfiles =="
|
||||
system! "bin/rails log:clear tmp:clear"
|
||||
|
||||
Reference in New Issue
Block a user