Simplify development environment setup

Rails provides a script that already did most of the steps.
This commit is contained in:
Javi Martín
2023-07-22 03:03:42 +02:00
parent f209325b90
commit ed4f8ad6d9
3 changed files with 11 additions and 16 deletions

View File

@@ -43,13 +43,8 @@ Prerequisites: install git, Ruby 3.1.4, CMake, pkg-config, shared-mime-info, Nod
```bash ```bash
git clone https://github.com/consuldemocracy/consuldemocracy.git git clone https://github.com/consuldemocracy/consuldemocracy.git
cd consuldemocracy cd consuldemocracy
bundle install bin/setup
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/rake db:dev_seed bin/rake db:dev_seed
RAILS_ENV=test rake db:setup
``` ```
Run the app locally: Run the app locally:

View File

@@ -41,13 +41,8 @@ Prerequisitos: tener instalado git, Ruby 3.1.4, CMake, pkg-config, shared-mime-i
```bash ```bash
git clone https://github.com/consuldemocracy/consuldemocracy.git git clone https://github.com/consuldemocracy/consuldemocracy.git
cd consuldemocracy cd consuldemocracy
bundle install bin/setup
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/rake db:dev_seed bin/rake db:dev_seed
RAILS_ENV=test rake db:setup
``` ```
Para ejecutar la aplicación en local: Para ejecutar la aplicación en local:

View File

@@ -17,13 +17,18 @@ FileUtils.chdir APP_ROOT do
system! "gem install bundler --conservative" system! "gem install bundler --conservative"
system("bundle check") || system!("bundle install") system("bundle check") || system!("bundle install")
# puts "\n== Copying sample files ==" puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml') unless File.exist?("config/database.yml")
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml' FileUtils.cp "config/database.yml.example", "config/database.yml"
# end end
unless File.exist?("config/secrets.yml")
FileUtils.cp "config/secrets.yml.example", "config/secrets.yml"
end
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system! "bin/rails db:prepare" system! "bin/rails db:prepare"
system! "RAILS_ENV=test bin/rails db:prepare"
puts "\n== Removing old logs and tempfiles ==" puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear" system! "bin/rails log:clear tmp:clear"