Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18630] Deploy renamed seeder to staging #53

Merged
merged 10 commits into from
Jun 28, 2024
6 changes: 3 additions & 3 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/src/packages/connectors/connector-saml/README.md:private-key:101
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder.json:generic-api-key:33
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder.json:generic-api-key:42
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder.json:generic-api-key:151
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json:generic-api-key:37
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json:generic-api-key:46
/src/packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json:generic-api-key:157
6 changes: 3 additions & 3 deletions README.OGCIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ USER_DEFAULT_ORGANIZATION_ROLE_NAMES=OGCIO Employee, OGCIO Manager

3. After the installation, you can start seeding the database. You have to seed in two steps:
- seed Logto's database: `pnpm cli db seed`
- seed custom OGCIO data: `npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder.json"`
- seed custom OGCIO data: `npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json"`

3.5. Database alteration

Expand Down Expand Up @@ -98,7 +98,7 @@ After installing and seeding the database, you must create a default admin user.

## Custom seeder

We made a custom seeder to ensure the required configuration for OGCIO Building Block integration exists right after the installation. The seeder also makes configuring the deployed Logto instance easy via a CI pipeline. The seeder is located in `packages/cli/src/commands/database/ogcio/`. The configuration for the local dev environment is inside `packages/cli/src/commands/database/ogcio/ogcio-seeder.json`.
We made a custom seeder to ensure the required configuration for OGCIO Building Block integration exists right after the installation. The seeder also makes configuring the deployed Logto instance easy via a CI pipeline. The seeder is located in `packages/cli/src/commands/database/ogcio/`. The configuration for the local dev environment is inside `packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json`.

Each type of configuration has its own dedicated file, which serves as a repository of knowledge about the structure of the configuration and how it should be inserted into the database. This approach ensures a systematic and organized management of the database configuration.

Expand All @@ -112,4 +112,4 @@ This command can take a parameter to specify the input data file, called `seeder

Usage: `npm run cli db ogcio -- --seeder-filepath="DATA_FILE_PATH"`

To seed the default data for local dev environments, run `npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder.json"`.
To seed the default data for local dev environments, run `npm run cli db ogcio -- --seeder-filepath="./packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json"`.
2 changes: 1 addition & 1 deletion docker-compose-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
[
"sh",
"-c",
"npm run cli db seed -- --swe && npm run cli db alteration deploy latest && npm run cli db ogcio -- --seeder-filepath=\"/etc/logto/packages/cli/src/commands/database/ogcio/ogcio-seeder.json\" && npm start"
"npm run cli db seed -- --swe && npm run cli db alteration deploy latest && npm run cli db ogcio -- --seeder-filepath=\"/etc/logto/packages/cli/src/commands/database/ogcio/ogcio-seeder-local.json\" && npm start"
]
ports:
- 3301:3301
Expand Down
Loading