From fb9219a52fdc3160358c4ffa8bbe26cd817b007c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 21 Dec 2022 17:08:30 +0000 Subject: [PATCH] Use rails instead of rake --- .github/workflows/lint.yml | 4 ++-- .github/workflows/tests.yml | 6 +++--- CONFIGURE.md | 4 ++-- CONTRIBUTING.md | 2 +- DOCKER.md | 2 +- Dockerfile | 2 +- INSTALL.md | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 11a4c322f..94eb05df9 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -54,11 +54,11 @@ jobs: restore-keys: | yarn-${{ env.os }}- - name: Install node modules - run: bundle exec rake yarn:install + run: bundle exec rails yarn:install - name: Create dummy database configuration run: cp config/example.database.yml config/database.yml - name: Run eslint - run: bundle exec rake eslint + run: bundle exec rails eslint brakeman: name: Brakeman runs-on: ubuntu-20.04 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ee32c449..702f29264 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,13 +48,13 @@ jobs: - name: Populate database run: | sed -f script/normalise-structure db/structure.sql > db/structure.expected - bundle exec rake db:migrate + bundle exec rails db:migrate sed -f script/normalise-structure db/structure.sql > db/structure.actual diff -uw db/structure.expected db/structure.actual - name: Export javascript strings - run: bundle exec rake i18n:js:export + run: bundle exec rails i18n:js:export - name: Install node modules - run: bundle exec rake yarn:install + run: bundle exec rails yarn:install - name: Run tests run: bundle exec rails test:all - name: Report completion to Coveralls diff --git a/CONFIGURE.md b/CONFIGURE.md index af93dcaef..3bf0724fc 100644 --- a/CONFIGURE.md +++ b/CONFIGURE.md @@ -127,7 +127,7 @@ If your installation stops working for some reason: * The OSM database schema is changed periodically and you need to keep up with these improvements. Go to your `openstreetmap-website` directory and run: ``` -bundle exec rake db:migrate +bundle exec rails db:migrate ``` ## Testing on the osm dev server @@ -145,5 +145,5 @@ If you want to deploy `openstreetmap-website` for production use, you'll need to * It's not recommended to use `rails server` in production. Our recommended approach is to use [Phusion Passenger](https://www.phusionpassenger.com/). Instructions are available for [setting it up with most web servers](https://www.phusionpassenger.com/documentation_and_support#documentation). * Passenger will, by design, use the Production environment and therefore the production database - make sure it contains the appropriate data and user accounts. * The included version of the map call is quite slow and eats a lot of memory. You should consider using [CGIMap](https://github.com/zerebubuth/openstreetmap-cgimap) instead. -* Make sure you generate the i18n files and precompile the production assets: `RAILS_ENV=production rake i18n:js:export assets:precompile` +* Make sure you generate the i18n files and precompile the production assets: `RAILS_ENV=production rails i18n:js:export assets:precompile` * Make sure the web server user as well as the rails user can read, write and create directories in `tmp/`. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e878a30c..99286692e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,7 @@ development to check that your code matches our guidelines: ``` bundle exec rubocop -bundle exec rake eslint +bundle exec rails eslint bundle exec erblint . ``` diff --git a/DOCKER.md b/DOCKER.md index d0b16db07..2df50bea9 100644 --- a/DOCKER.md +++ b/DOCKER.md @@ -54,7 +54,7 @@ This will launch one Docker container for each 'service' specified in `docker-co Run the Rails database migrations: - docker-compose run --rm web bundle exec rake db:migrate + docker-compose run --rm web bundle exec rails db:migrate ### Tests diff --git a/Dockerfile b/Dockerfile index aae65c2bb..7d5d4982c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,6 @@ RUN gem install bundler \ && bundle install # Install NodeJS packages using yarnpkg -# `bundle exec rake yarn:install` will not work +# `bundle exec rails yarn:install` will not work ADD package.json yarn.lock /app/ RUN yarnpkg --ignore-engines install diff --git a/INSTALL.md b/INSTALL.md index 6815bab1f..b19ce4ffc 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -137,7 +137,7 @@ bundle install We use [Yarn](https://yarnpkg.com/) to manage the Node.js modules required for the project. ``` -bundle exec rake yarn:install +bundle exec rails yarn:install ``` ## Prepare local settings file @@ -185,7 +185,7 @@ exit To create the three databases - for development, testing and production - run: ``` -bundle exec rake db:create +bundle exec rails db:create ``` ### Database structure @@ -193,7 +193,7 @@ bundle exec rake db:create To create all the tables, indexes and constraints, run: ``` -bundle exec rake db:migrate +bundle exec rails db:migrate ``` ## Running the tests -- 2.39.5