@@ -12,6 +12,56 @@ The `setup` task is a alias for `gitlab:setup`.
This tasks calls `db:reset` to create the database, calls `add_limits_mysql` that adds limits to the database schema in case of a MySQL database and finally it calls `db:seed_fu` to seed the database.
Note: `db:setup` calls `db:seed` but this does nothing.
### Automation
If you're very sure that you want to **wipe the current database** and refill
seeds, you could:
``` shell
echo'yes' | bundle exec rake setup
```
To save you from answering `yes` manually.
### Discard stdout
Since the script would print a lot of information, it could be slowing down
your terminal, and it would generate more than 20G logs if you just redirect
it to a file. If we don't care about the output, we could just redirect it to
`/dev/null`:
``` shell
echo'yes' | bundle exec rake setup > /dev/null
```
Note that since you can't see the questions from stdout, you might just want
to `echo 'yes'` to keep it running. It would still print the errors on stderr
so no worries about missing errors.
### Notes for MySQL
Since the seeds would contain various UTF-8 characters, such as emojis or so,
we'll need to make sure that we're using `utf8mb4` for all the encoding
settings and `utf8mb4_unicode_ci` for collation. Please check
requires:domain_blacklist,type: String,desc: 'Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com'
end
optional:after_sign_up_text,type: String,desc: 'Text shown after sign up'
optional:signin_enabled,type: Boolean,desc: 'Flag indicating if sign in is enabled'
optional:password_authentication_enabled,type: Boolean,desc: 'Flag indicating if password authentication is enabled'
optional:signin_enabled,type: Boolean,desc: 'Flag indicating if password authentication is enabled'
requires:two_factor_grace_period,type: Integer,desc: 'Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication'
requires:domain_blacklist,type: String,desc: 'Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com'
end
optional:after_sign_up_text,type: String,desc: 'Text shown after sign up'
optional:signin_enabled,type: Boolean,desc: 'Flag indicating if sign in is enabled'
optional:password_authentication_enabled,type: Boolean,desc: 'Flag indicating if password authentication is enabled'
optional:signin_enabled,type: Boolean,desc: 'Flag indicating if password authentication is enabled'
requires:two_factor_grace_period,type: Integer,desc: 'Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication'