Is there a cli equivalent of Github cli for Bitbucket? - github

I'm looking for a Bitbucket tool that is similar to the Github cli. I'm aware of API, but that's not what I'm looking for. This tool is for the Bitbucket cloud version.

i don't think so there is one yet officially. If it's of any use, you could make use of my script https://github.com/psadi/bbcli - it is api based, and its for enterprise.

Related

How to export jFrog Artifactory repositories through REST API or a jFrog CLI command?

Using the UI, I can export Artifactory repositories. I'll be able to do it as mentioned in the documentation.
But what if I want to do it through a Rest API call or a jFrog CLI command?
JFrog has a CLI that can be used for many kinds of command line, automated or maintenance tasks. This CLI integrates great with CI/CD and with on demand tasks like downloading a file or a full repository.
Another option is to use the Artifactory REST API, which can be used to download a whole repository or folder from it. There are a zillion options for the REST API.
For system export, you need to use the Export System REST API call.

Automate mirroring GitHub to GCP Source Repository?

We run Google Cloud Functions (python), which require to be deployed from Google Cloud Source Repository. Since all the code is stored on GitHub we resort to first mirroring GitHub into Source Repository. Although this only requires a few mouse clicks, it becomes a burden to repeat over 3+ projects (dev, staging, production) times 5+ repos (5+ apps).
I am looking to automate the mirroring config, preferably to add into the Terraform automation we already use, into a hands-off project configuration. Does the Google API support this mirroring automation? So far on my Google Cloud expedition everything was available in their API!
I fail to find Terraform examples though, and would appreciate a tip.
Come to think of it, if I can take Source Repository out of the equation, that would be just fine with me too. After all, I only use it as a pass-through / empty shell.
The Cloud Source Repository API includes a Repo resource that has a Mirror Config object where you could type in your Github's URL, webhook and credentials to automate this procedure. I would initially test it with the create method, but if you have an existing Cloud Source Repository I believe the patch method will also be worth exploring.
Additionally, there is an open Feature Request in order to connect a repository via the Cloud Build GitHub App that I recommend you to star and follow, as it could further ease your automation needs.

Modifying pre-receive hooks on Bitbucket Cloud

We have Bitbucket Cloud not Bitbucket Server. Is there a way to modify the "pre-receive" functions on Bitbucket? Goal is to audit pushes to make sure there's no obvious vulnerabilities before the code is available on Bitbucket. Git-hooks might work but there's not really a way to get them into version control in the same repo - the only way I can think of doing that would be to ssh into a Bitbucket server and modify the remote repo but I don't think you can do that?
My only guess is there might be a way to keep the pre-receive hooks in source control by putting the hook somewhere like this in the repo:
.bitbucket/pre-receive
But it's hard to find any info on this online.
Unfortunately, this isn't possible.
The GitHub documentation is talking about GitHub Enterprise Server, a product you would install on your own infrastructure. GitHub as in github.com does not support creating pre-receive hooks at all. This is pretty much the norm amongst the popular cloud git hosting providers - no cloud provider will let you write your own arbitrary code and run it on the same infrastructure that holds your git repo, there's too much danger of you breaking out into other data on the same physical storage.
Until someone develops a safe/sandboxed implementation of server-side hooks, you'll need to find another way.
Full disclosure: I work for Atlassian (though I don't work on Bitbucket Cloud)

How to export all the comments added as part of a merge request on git - ibm bluemix

How can i export or get all the comments added as part of merge request on git - IBM Bluemix.
I got options from gitlab.
Any API is available from ibm bluemix git ?
Yes, I think this is the API you are looking for:
https://git.ng.bluemix.net/help/api/notes.md#list-all-merge-request-notes (ng might be different depending on your region)
Here's an example request:
https://git.ng.bluemix.net/api/v4/projects/:id/merge_requests/:merge_request_iid/notes?private_token=YOUR_PRIVATE_TOKEN
The version of Git used by the IBM Cloud is based on GitLab Community Edition. You should be able to use the GitLab API, to do anything you want to automate.

How to create a new Azure Website with integration to private Github repo using the Azure REST API?

There are many trivial examples that show how this is done without the Github integration. The Azure Powershell commandlet New-AzureWebsite supports only public repos (can be confirmed from source code [1]). Has anyone tried to create it with a connection to a private repo? It doesn't seem to be documented anywhere.
UPDATE: I've realized this might be something Kudu helps me with.
[1] https://github.com/Azure/azure-powershell/blob/e06a22c22f7a1c8153e9c2fa7c159ae7b1fd1dab/src/ServiceManagement/Services/Commands.Utilities/Websites/Services/GithubClient.cs#L124
We have not added the functionality to powershell. However, you could try using the ARMClient tool below to achieve just that. See its readme and wiki for info.
https://github.com/projectkudu/ARMClient
https://github.com/projectkudu/ARMClient/wiki/Setup-GitHub-publishing-to-Site