mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-01-17 06:52:27 +01:00
use rails instead of rake
This commit is contained in:
parent
83f1e9039b
commit
d74790e3da
@ -112,19 +112,19 @@ This procedure is not easy to follow so if you don't need to write some code for
|
||||
```
|
||||
|
||||
13. Build the databases.
|
||||
> **⚠ Warning**: **DO NOT** run `rake db:setup` instead of these commands, as this will not run some required raw SQL instructions.
|
||||
> **⚠ Warning**: **DO NOT** run `rails db:setup` instead of these commands, as this will not run some required raw SQL instructions.
|
||||
|
||||
> **🛈 Please note**: Your password length must be between 8 and 128 characters, otherwise db:seed will be rejected. This is configured in [config/initializers/devise.rb](config/initializers/devise.rb)
|
||||
|
||||
```bash
|
||||
# for dev
|
||||
rake db:create
|
||||
rake db:migrate
|
||||
ADMIN_EMAIL='youradminemail' ADMIN_PASSWORD='youradminpassword' rake db:seed
|
||||
rake fablab:es:build_stats
|
||||
rails db:create
|
||||
rails db:migrate
|
||||
ADMIN_EMAIL='youradminemail' ADMIN_PASSWORD='youradminpassword' rails db:seed
|
||||
rails fablab:es:build_stats
|
||||
# for tests
|
||||
RAILS_ENV=test rake db:create
|
||||
RAILS_ENV=test rake db:migrate
|
||||
RAILS_ENV=test rails db:create
|
||||
RAILS_ENV=test rails db:migrate
|
||||
```
|
||||
|
||||
14. Create the pids folder used by Sidekiq. If you want to use a different location, you can configure it in `config/sidekiq.yml`
|
||||
@ -170,7 +170,7 @@ If the scheduled task wasn't executed for any reason (eg. you are in a dev envir
|
||||
|
||||
```bash
|
||||
# Here for the 50 last days
|
||||
rake fablab:es:generate_stats[50]
|
||||
rails fablab:es:generate_stats[50]
|
||||
```
|
||||
|
||||
<a name="backup-and-restore-elasticsearch"></a>
|
||||
|
@ -147,7 +147,7 @@ Copy [elasticsearch.yml](../docker/elasticsearch.yml) and [log4j2.properties](..
|
||||
|
||||
Finally reindex your data:
|
||||
```bash
|
||||
rake fablab:es:build_stats
|
||||
rake fablab:es:generate_stats[3000]
|
||||
rake fablab:es:build_projects_index
|
||||
rails fablab:es:build_stats
|
||||
rails fablab:es:generate_stats[3000]
|
||||
rails fablab:es:build_projects_index
|
||||
```
|
||||
|
@ -50,7 +50,7 @@ When using docker-compose, you should provide the name of the service in your [d
|
||||
|
||||
Used by the authentication system to generate random tokens, eg. for resetting passwords.
|
||||
Used by Rails to verify the integrity of signed cookies.
|
||||
You can generate such a random key by running `rake secret`.
|
||||
You can generate such a random key by running `rails secret`.
|
||||
<a name="STRIPE_API_KEY"></a><a name="STRIPE_PUBLISHABLE_KEY"></a>
|
||||
|
||||
STRIPE_API_KEY & STRIPE_PUBLISHABLE_KEY
|
||||
@ -60,7 +60,7 @@ Retrieve them from https://dashboard.stripe.com/account/apikeys.
|
||||
|
||||
**MANDATORY**: Even if you don't want to charge your customers, you must fill this settings.
|
||||
For this purpose, you can use a stripe account in test mode, which will provide you test keys.
|
||||
If you change these keys during the application lifecycle, you must run `rake fablab:stripe:sync_members`, otherwise your users won't be able to do card payments.
|
||||
If you change these keys during the application lifecycle, you must run `rails fablab:stripe:sync_members`, otherwise your users won't be able to do card payments.
|
||||
<a name="STRIPE_CURRENCY"></a>
|
||||
|
||||
STRIPE_CURRENCY
|
||||
@ -239,7 +239,7 @@ The check will run every weeks and if the threshold is exceeded, an alert will b
|
||||
ADMIN_EMAIL, ADMIN_PASSWORD
|
||||
|
||||
Credentials for the first admin user created when seeding the project.
|
||||
By default, theses variables are not present in application.yml because they are only used once, when running the database seed with the command `rake db:seed`.
|
||||
By default, theses variables are not present in application.yml because they are only used once, when running the database seed with the command `rails db:seed`.
|
||||
<a name="SUPERADMIN_EMAIL"></a>
|
||||
|
||||
SUPERADMIN_EMAIL
|
||||
@ -329,7 +329,7 @@ See [ElasticSearch guide](https://www.elastic.co/guide/en/elasticsearch/referenc
|
||||
|
||||
TIME_ZONE
|
||||
|
||||
In Rails: set Time.zone default to the specified zone and make Active Record auto-convert to this zone. Run `rake time:zones:all` for a list of available time zone names.
|
||||
In Rails: set Time.zone default to the specified zone and make Active Record auto-convert to this zone. Run `rails time:zones:all` for a list of available time zone names.
|
||||
Default is **UTC**.
|
||||
<a name="WEEK_STARTING_DAY"></a>
|
||||
|
||||
|
@ -137,7 +137,7 @@ docker-compose restart nginx
|
||||
```
|
||||
- Example of command passing env variables
|
||||
```bash
|
||||
docker-compose run --rm -e ADMIN_EMAIL=xxx -e ADMIN_PASSWORD=xxx fabmanager bundle exec rake db:seed
|
||||
docker-compose run --rm -e ADMIN_EMAIL=xxx -e ADMIN_PASSWORD=xxx fabmanager bundle exec rails db:seed
|
||||
```
|
||||
<a name="update-fabmanager"></a>
|
||||
## Update Fab-manager
|
||||
@ -170,7 +170,7 @@ You can subscribe to [this atom feed](https://github.com/sleede/fab-manager/rele
|
||||
|
||||
5. compile new assets
|
||||
|
||||
`docker-compose run --rm fabmanager bundle exec rake assets:precompile`
|
||||
`docker-compose run --rm fabmanager bundle exec rails assets:precompile`
|
||||
|
||||
6. run specific commands
|
||||
|
||||
|
@ -54,14 +54,14 @@ For this guide, we will use [GitHub](https://developer.github.com/v3/oauth/) as
|
||||
|
||||
```bash
|
||||
# replace GitHub with the name of the provider you just created
|
||||
rake fablab:auth:switch_provider[GitHub]
|
||||
rails fablab:auth:switch_provider[GitHub]
|
||||
```
|
||||
|
||||
- As the command just prompted you, you have to re-compile the assets
|
||||
- In development, `rake tmp:clear` will do the job.
|
||||
- In production with Docker, `rm -rf public/assets`, followed by `docker-compose run --rm fabmanager bundle exec rake assets:precompile`
|
||||
- In development, `rails tmp:clear` will do the job.
|
||||
- In production with Docker, `rm -rf public/assets`, followed by `docker-compose run --rm fabmanager bundle exec rails assets:precompile`
|
||||
- Then restart the web-server or the container.
|
||||
- Finally, to notify all existing users about the change (and send them their migration code/link), run:
|
||||
```bash
|
||||
rake fablab:auth:notify_changed
|
||||
rails fablab:auth:notify_changed
|
||||
```
|
||||
|
@ -50,14 +50,14 @@ the host can provide but will usually be much more slower than a production envi
|
||||
included in the migrations. Password minimal length is 8 characters):
|
||||
|
||||
```bash
|
||||
rake db:create
|
||||
rake db:migrate
|
||||
rails db:create
|
||||
rails db:migrate
|
||||
# Be sure not to use the default values below in production
|
||||
ADMIN_EMAIL='admin@email' ADMIN_PASSWORD='adminpass' rake db:seed
|
||||
rake fablab:es:build_stats
|
||||
ADMIN_EMAIL='admin@email' ADMIN_PASSWORD='adminpass' rails db:seed
|
||||
rails fablab:es:build_stats
|
||||
# for tests
|
||||
RAILS_ENV=test rake db:create
|
||||
RAILS_ENV=test rake db:migrate
|
||||
RAILS_ENV=test rails db:create
|
||||
RAILS_ENV=test rails db:migrate
|
||||
```
|
||||
|
||||
8. Start the application and visit `localhost:3000` on your browser to check that it works:
|
||||
|
@ -14,7 +14,7 @@ development:
|
||||
database: fablab_development
|
||||
|
||||
# Warning: The database defined as "test" will be erased and
|
||||
# re-generated from your development database when you run "rake".
|
||||
# re-generated from your development database when you run "rails".
|
||||
# Do not set this db to the same as development or production.
|
||||
test:
|
||||
<<: *default
|
||||
|
@ -59,7 +59,7 @@ namespace :fablab do
|
||||
|
||||
desc 'add missing VAT rate to history'
|
||||
task :add_vat_rate, %i[rate date] => :environment do |_task, args|
|
||||
raise 'Missing argument. Usage exemple: rake fablab:setup:add_vat_rate[20,2014-01-01]. Use 0 to disable' unless args.rate && args.date
|
||||
raise 'Missing argument. Usage exemple: rails fablab:setup:add_vat_rate[20,2014-01-01]. Use 0 to disable' unless args.rate && args.date
|
||||
|
||||
if args.rate == '0'
|
||||
setting = Setting.find_by(name: 'invoice_VAT-active')
|
||||
|
Loading…
x
Reference in New Issue
Block a user