Skip to content

seed data at startup #1950

@y-nk

Description

@y-nk

Feature Request

Motivation

When starting svix-server in local (for local dev, mostly) there's often a need to create a project and sometimes additional data (events) to start working. This can be automated with using svix-cli either as a separate step, or even integrated into a docker-compose job after the boot of the svix-server.

  1. an additional step with svix-cli would mean changing the startup command from docker compose up --detach --wait to be docker compose up --detach --wait && ./seed-svix.sh

  2. an additional step with docker-compose means more or less the same thing but as a docker service. note that if using --wait, the job would end and therefore the exit code would be != 0 (which can be deceptive)

Solution works but somehow doesn't feel clean, or at least as clean as others.

Proposal

Multiple possibilities:

  1. do as stack-auth and propose a limited set of seed data built from env vars. that would mean extra coding and env var support in the seed script.

  2. do as postgres/mongo/most-db: add a client in the server container and let users add an init.d/ script. that would mean adding svix-cli in the svix-server image and good api support from the svix-cli.

The 2nd solution would also mean that healthcheck command could be added to the svix-cli which looks like a better fit for this (rather than within svix-server)

Metadata

Metadata

Assignees

No one assigned

    Labels

    serverIssues regarding the server component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions