Configuration
Gitmars reads its config through cosmiconfig, so any supported config filename/format works — .gitmarsrc, .gitmarsrc.json, .gitmarsrc.js, .config/gitmarsrc, or a gitmars field in package.json. The name .gitmarsrc is conventional, not hardcoded.
Two merged layers (v7.9.0+)
| Layer | Search from | Priority |
|---|---|---|
| Global | home directory | base |
| Project | project root | overrides global |
The merge is a shallow Object.assign: project-level top-level keys replace global ones of the same name. To override buildSecret in a project, provide the complete block — overriding a single nested field is not supported.
Quick example
json
{
"master": "master",
"develop": "dev",
"gitHost": "https://gitlab.com",
"gitID": "1234",
"apis": {
"buildConfig": {
"url": "https://example.com/api/gitmars/getBuildConfig",
"method": "get",
"params": { "name": "my-team" }
},
"userInfo": { "url": "https://example.com/api/users/getUserInfoByGitName" }
},
"buildSecret": {
"username": "jenkins_username",
"password": "jenkins_password",
"miniprogramToken": "",
"miniprogramSession": "sessionID",
"gitNotificationGroupUrl": "https://..."
}
}
gitIDis per-project — keep it in the project-level config only. Never commitbuildSecret; recommended file mode is0600.
Full reference
See Basic Config for every parameter, including buildSecret and Global and project config.
Upgrading from 7.8.0? See the changelog.