Use rails instead of rake

This commit is contained in:
Tom Hughes 2022-12-21 17:08:30 +00:00
parent 6f471c72c9
commit fb9219a52f
7 changed files with 13 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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/`.

View file

@ -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 .
```

View file

@ -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

View file

@ -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

View file

@ -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