| title | GIT Provider for dynamic configuration |
|---|---|
| description | Pull your dynamic configuration from a GIT repository. |
Pull your dynamic configuration from a GIT repository.
After cloning a GIT repository Mokapi uses the <a href="/docs/configuration/dynamic/file">File Provider</a> to read the
containing files.
providers:
git:
url: https://github.com//PATH-TO/REPOSITORY--providers-git-url https://github.com//PATH-TO/REPOSITORYMOKAPI_PROVIDERS_GIT_URL=https://github.com//PATH-TO/REPOSITORYA list of all options that can be used with the GIT provider, refer to the reference page.
Defines the URL to the GIT repository. With the query parameter ref you can specify an alternative
branch.
providers:
git:
url: https://github.com/PATH-TO/REPOSITORY?ref=branch-name--providers-git-url="https://github.com/PATH-TO/REPOSITORY?ref=branch-name"MOKAPI_PROVIDERS_GIT_URL=https://github.com/PATH-TO/REPOSITORY?ref=branch-nameDefines in which interval Mokapi pulls possible changes, default 3 minutes.
Valid time units are ns, us (or µs), ms, s, m, h.
providers:
git:
pullInterval: 3m30s--providers-git-pull-interval 3m30sMOKAPI_PROVIDERS_GIT_PULL-INTERVAL=3m30sproviders:
repositories:
- url: https://github.com/PATH-TO/REPOSITORY
pullInterval: 5m--providers-git-repositories[0]-url="https://github.com/PATH-TO/REPOSITORY" --providers.git.repositories[0].pullInterval="5m"MOKAPI_PROVIDERS_GIT_REPOSITORIES[0]_URL=https://github.com/PATH-TO/REPOSITORY
MOKAPI_PROVIDERS_GIT_REPOSITORIES[0]_PULL_INTERVAL=5mSpecifies an allow list of files. Mokapi will only read these files.
providers:
git:
repositories:
- url: https://github.com/PATH-TO/REPOSITORY
files: ['mokapi/api.json']Specifies an array of filenames or patterns. Mokapi will only read these files.
providers:
git:
repositories:
- url: https://github.com/PATH-TO/REPOSITORY
include: ['mokapi/**/*.json']Specifies a specific pull interval for this repository
providers:
git:
repositories:
- url: https://github.com/PATH-TO/REPOSITORY
pullInterval: 3m30sBy default, Mokapi checks out all repositories to system's temp directory. You can use the tempDir option to override the default path.
Default path
- On Unix systems, it uses $TMPDIR if non-empty, else /tmp.
- On Windows, it uses the first non-empty value from %TMP%, %TEMP%, %USERPROFILE%, or the Windows directory.
providers:
git:
url: https://github.com/PATH-TO/REPOSITORY?ref=branch-name
tempDir: /path-to/repositoriesproviders:
repositories:
- url: https://github.com/PATH-TO/REPOSITORY
auth:
github:
appId: 12345
installationId: 123456789
privateKey: 2024-2-25.private-key.pemYou can find your app's ID on the settings page for your GitHub App. Navigate to your Settings > Developer Settings > GitHub Apps > Your GitHub App > Edit.
Your installation ID can be found in the organization or user that you have installed your GitHub App too.
For users, please navigate to your Settings > Developer Settings > GitHub Apps > Your GitHub App > Edit > Install App > Configure Installation. The installation ID can be found at the end of the URL - if the URL is https://github.com/settings/installations/123456789, your installation id is 123456789
Set content of your private key or path to your private key file. You can download your private key by navigating to Settings > Developer Settings > GitHub Apps > Your GitHub App > Edit