1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-23 00:22:19 +01:00

Merge pull request #1243 from Unleash/docs/import-polish

docs: restructure startup import section to group actions by intent
This commit is contained in:
Thomas Heartman 2022-01-07 10:33:03 +01:00 committed by GitHub
commit abc3867070
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -118,38 +118,34 @@ Unleash lets you do this both via configuration parameters and environment varia
| `importFile` | `IMPORT_FILE` | none | path to the configuration file | | `importFile` | `IMPORT_FILE` | none | path to the configuration file |
| `dropBeforeImport` | `IMPORT_DROP_BEFORE_IMPORT` | `false` | whether to clean the database before importing the file | | `dropBeforeImport` | `IMPORT_DROP_BEFORE_IMPORT` | `false` | whether to clean the database before importing the file |
### Import files via config parameter {#import-files-via-config-parameter} ### Importing files
To import strategies and toggles from a file (`configuration.yml` in the examples), you use the `importFile` parameter:
To import strategies and toggles from a file (called `configuration.yml` in the examples below), either
- use the `importFile` parameter to point to the file (you can also passed this into the `unleash.start()` entry point)
``` shell ``` shell
unleash-server --databaseUrl [...] \ unleash-server --databaseUrl [...] \
--importFile configuration.yml --importFile configuration.yml
``` ```
To clean the database before import (all strategies and features will be removed), add the `dropBeforeImport` flag: - set the `IMPORT_FILE` environment variable to the path of the file before starting Unleash
:::caution
You should never use this in production environments.
:::
``` shell
unleash-server --databaseUrl [...] \
--importFile configuration.yml \
--dropBeforeImport
```
You can also pass these options into the `unleash.start()` entry point.
### Import files via environment variables
Use the `IMPORT_FILE` environment variable to set the path to the import file. For instance:
``` shell ``` shell
IMPORT_FILE=configuration.yml IMPORT_FILE=configuration.yml
``` ```
To clean the database before import, set the `IMPORT_DROP_BEFORE_IMPORT` (note the leading `IMPORT_`) variable to `true`, `t`, or `1`. The variable is case-sensitive. ### Drop before import
:::caution
You should never use this in production environments.
:::
To remove pre-existing feature toggles and strategies in the database before importing the new ones, either:
- add the `dropBeforeImport` flag to the `unleash-server` command (or to `unleash.start()`)
``` shell
unleash-server --databaseUrl [...] \
--importFile configuration.yml \
--dropBeforeImport
```
- set the `IMPORT_DROP_BEFORE_IMPORT` environment variable (note the leading `IMPORT_`) to `true`, `t`, or `1`. The variable is case-sensitive.
``` shell ``` shell
IMPORT_DROP_BEFORE_IMPORT=true IMPORT_DROP_BEFORE_IMPORT=true