如何使用 Bitbucket API 使用特定插件检索回购列表?
How to retrieve the list of repos using a particular plugin using Bitbucket API?
我想检索使用特定插件的 Bitbucket 项目中的回购列表。
我已经完成了 Bitbucket 的 REST API documentation,但我似乎找不到实现它的方法。
使用这个,我可以只获取一个repo的插件信息。
http://bitbucket.org.com/rest/api/1.0/projects/$ProjectKey/repos/$RepoKey/settings/hooks/com.trimble.tekla.TeamCityTriggerHook-SonarFix:TeamcityTriggerHook
有没有一种方法可以使用特定的(在我的例子中是 Sonar Fix Teamcity TriggerHook 插件)检索所有回购协议?
执行以下操作:
for r in $(curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/projects/PROJECT/repos | jq --raw-output '.values[].slug')
do
hook=$(curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/projects/GP/repos/$r/settings/hooks/com.trimble.tekla.TeamCityTriggerHook-SonarFix:TeamcityTriggerHook | jq --raw-output '.enabled')
echo -n "$r => $hook"
echo ""
done
要得到这样的东西:
REPO1 => true
REPO2 => false
REPO3 => true
...
我想检索使用特定插件的 Bitbucket 项目中的回购列表。
我已经完成了 Bitbucket 的 REST API documentation,但我似乎找不到实现它的方法。
使用这个,我可以只获取一个repo的插件信息。
http://bitbucket.org.com/rest/api/1.0/projects/$ProjectKey/repos/$RepoKey/settings/hooks/com.trimble.tekla.TeamCityTriggerHook-SonarFix:TeamcityTriggerHook
有没有一种方法可以使用特定的(在我的例子中是 Sonar Fix Teamcity TriggerHook 插件)检索所有回购协议?
执行以下操作:
for r in $(curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/projects/PROJECT/repos | jq --raw-output '.values[].slug')
do
hook=$(curl -s --user USER:PASS --request GET https://BITBUCKET-SERVER/rest/api/1.0/projects/GP/repos/$r/settings/hooks/com.trimble.tekla.TeamCityTriggerHook-SonarFix:TeamcityTriggerHook | jq --raw-output '.enabled')
echo -n "$r => $hook"
echo ""
done
要得到这样的东西:
REPO1 => true
REPO2 => false
REPO3 => true
...