2

我已经下载了 SCM-manager-CLI

我需要通过 CLI 在 SCM-manager 中为 GIT 存储库设置分支写保护

我通过网络应用程序设置了相同的

我需要通过 CLI 作为自动化的一部分来做到这一点

怎么做?

4

1 回答 1

0

您好cli目前不支持属性,但您可以使用rest api来设置属性:

curl -u scmadmin:scmadmin -v http://localhost:8080/scm/api/rest/repositories -XPOST -H 'Content-Type: application/json' -d '{
  "name": "newrepository",
  "description": "repository with branch protection",
  "type": "git",
  "properties": [
    { "key": "branchwp.enabled", "value": true },
    { "key": "branchwp.permissions", "value": "master,userone;develop,@devgroup;" }
  ],
  "permissions": [
    { "name": "userone", "type": "WRITE", "groupPermission": false },
    { "name": "devgroup", "type": "WRITE", "groupPermission": true }
  ]
}'

上面的示例创建了一个启用了分支保护的新存储库。

于 2017-12-10T13:19:44.833 回答