Syncs are the new mode through which you could bring in data from external sources into mergestat
. They are defined as container images,
and executed as containerized processes using the podman
runtime.
The main handler, defined at internal/jobs/sync/podman/podman.go
is responsible to pull, validate and execute the container images. It also defines a default environment where the execution happens.
There are a couple of MERGESTAT_
prefixed
variables defined that are passed to the container. Additionally, user-defined variables can also be passed to containers.
Syncs make use of Docker LABEL
to convey meta-information about the sync to the handler.
For example, the com.mergestat.sync.clone
controls whether the repo should be cloned and mounted locally or not.
MERGESTAT_REPO_ID
: the uniqueid
of the mergestat repository where the sync is runningMERGESTAT_REPO_URL
: the remote url of the mergestat repositoryMERGESTAT_POSTGRES_URL
: url of the postgres databaseMERGESTAT_PROVIDER_ID
: the uniqueid
of the provider the current repository is associated toMERGESTAT_AUTH_USERNAME
: the authentication username used for this providerMERGESTAT_AUTH_TOKEN
: the authentication password / token used for this providerMERGESTAT_PARAMS
: stringified JSON string representing additional user parameters
com.mergestat.sync.clone
: controls wheter the repository is cloned and mounted, or not