bitbucket-api

BitBucket get list of all contributors

岁酱吖の 提交于 2019-12-11 11:55:02
问题 Is there a way using the BitBucket API to get a list of all commiters/contributors to a repository? I know I can user git-shortlog for this purpose but would rather make an API call if possible. 回答1: No, we do not currently have that kind of data indexed, or available through the API. 来源: https://stackoverflow.com/questions/34472966/bitbucket-get-list-of-all-contributors

Configuring a bitbucket repository to “activate” pipelines

和自甴很熟 提交于 2019-12-11 09:14:43
问题 I have multiple repositories in a BitBucket project. I wish to automatically create a bitbucket repository, and enable pipelines (setting the pipeline configuration should be easy, with pushing a bitbucket-pipelines.yml file). How can I do it using the REST API? 回答1: You can create a repository with the BitBucket REST API. $ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "Foo" } }' https://api.bitbucket.org/2.0/repositories/<username>/<repo_slug> Push

Generate well-formed SSH key in JavaScript

社会主义新天地 提交于 2019-12-11 06:18:58
问题 I'm developing a Bitbucket API wrapper in JavaScript. I'm trying to write tests for the method which adds an SSH key. My naive attempt at creating a believable SSH key was unsuccessful. Here's how I generated a dummy key: start with "ssh-rsa " append the Base64-encoded representation of a 279 character string of random characters append " " append a 16 character string of random characters append "@" append a 16 character string of random characters append ".com" Bitbucket returns 400 Bad

Clone all BitBucket Repositories From a Project using jq

风格不统一 提交于 2019-12-11 06:02:32
问题 I am trying to clone all repositories in my team's project in BitBucket. I want to extract the url and the name from the JSON returned from the REST call and use those values to clone Below is what I have curl -s http://bitbucketlocalserver:7990/rest/api/1.0/projects/PROJECT_NAME/repos?per_page=20 ^ -u user:pass | H:\Downloads\Win64\jq-win64.exe -r ".values[] | .links.clone[] | select(.name==\"http\") | .href" ^ H:\Utilities\Git\usr\bin\xargs.exe -L1 git clone -b release/development This

Using BitBucket's API to fork a repository

。_饼干妹妹 提交于 2019-12-10 10:03:08
问题 There's any way to fork a repository using BB's API? From what I've read on the API's docs, there isn't any explicit one: https://confluence.atlassian.com/display/BITBUCKET/Repositories My idea is to create a new repo and point that it's a fork of another one, so I can create pull requests later. 回答1: You can use the API to fork a repository, either using Basic authorization or OAuth. The method to fork a repository: Using a authorized POST-request with required post data "name". https:/

Bitbucket OAuth returns “Could not verify OAuth request.”

两盒软妹~` 提交于 2019-12-07 19:49:24
问题 I'm attempting to use bitbucket's API through Python with rauth. My get_request_token call fails with the error: Key Error: 'Decoder failed to handle oauth_token with data as returned by provider. A different decoder may be needed. Provider returned: Could not verify OAuth request.' I wrote and tested this code a year ago and it worked then (on the same server, in fact). What is wrong now? 回答1: My server's clock was not within five minutes of bitbucket's. The answer was here: https:/

Howto use python urllib2 to create service POST with bitbucket API?

老子叫甜甜 提交于 2019-12-06 13:31:37
问题 While this code works fine to add a deployment ssh-key to my repos... print 'Connecting to Bitbucket...' bitbucket_access = base64.b64encode(userbb + ":" + passwordbb) bitbucket_headers = {"Content-Type":"application/json", "Authorization":"Basic " + bitbucket_access} bitbucket_request_url = "https://bitbucket.org/api/1.0/repositories/<username>/%s/deploy-keys" % project_name bitbucket_request_req = urllib2.Request(bitbucket_request_url) for key,value in bitbucket_headers.items(): bitbucket

Bitbucket OAuth returns “Could not verify OAuth request.”

非 Y 不嫁゛ 提交于 2019-12-06 05:31:00
I'm attempting to use bitbucket's API through Python with rauth. My get_request_token call fails with the error: Key Error: 'Decoder failed to handle oauth_token with data as returned by provider. A different decoder may be needed. Provider returned: Could not verify OAuth request.' I wrote and tested this code a year ago and it worked then (on the same server, in fact). What is wrong now? My server's clock was not within five minutes of bitbucket's. The answer was here: https://confluence.atlassian.com/display/BITBUCKET/Troubleshooting+OAuth+Requests Installing ntp solved this for me (on

Request OAuth token from BitBucket

非 Y 不嫁゛ 提交于 2019-12-05 23:49:00
问题 I've been trying to integrate BitBucket to my application for the past 4 hours to no avail. While reading through BitBucket's RESTful API documentation, I noticed that you need to use OAuth — it's OK, I'm using J.R Conlin's OAuthSimple library, which if fine by me (I tried oauth-php but it was kinda complicated — I didn't need all of those options for such a small integration). For what I understand, the first step to authenticate with OAuth is to request a new token via POST. When providing

Using BitBucket's API to fork a repository

独自空忆成欢 提交于 2019-12-05 22:49:56
There's any way to fork a repository using BB's API? From what I've read on the API's docs, there isn't any explicit one: https://confluence.atlassian.com/display/BITBUCKET/Repositories My idea is to create a new repo and point that it's a fork of another one, so I can create pull requests later. You can use the API to fork a repository, either using Basic authorization or OAuth. The method to fork a repository: Using a authorized POST-request with required post data "name". https://bitbucket.org/api/1.0/repositories/ {accountname}/{repo_slug}/fork/ Full documentation with optional parameters