Skip to content

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+) ​

LayerSearch fromPriority
Globalhome directorybase
Projectproject rootoverrides 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://..."
  }
}

gitID is per-project — keep it in the project-level config only. Never commit buildSecret; recommended file mode is 0600.

Full reference ​

See Basic Config for every parameter, including buildSecret and Global and project config.

Upgrading from 7.8.0? See the changelog.

Released under the GPL-3.0 License.