youngmon/atlassian-qna huggingface dataset:
Deploy to AWS Opsworks
Asked by sahr john:

Hello, I would like to build and deploy my php app (Wordpress) to AWS opsworks. I do not see a pipe for that yet. Also is there a possibility to set up a call to discuss best possible solutions. Although I am reaching you from my free personal account, I do have a premium account, if you do offer call sessions for premium accounts. Thank you!


Answers:
author: Theodora Boudale
body: Hello and welcome to the community!

Just to give you some context first: Bitbucket Pipelines builds run in Docker containers. For every step you define in your bitbucket-pipelines.yml file, a Docker container starts, the repo is cloned in that container (unless you disable cloning), and then the commands of that step's script are executed in that container. When the step finishes, the container gets destroyed.

If you don't specify a Docker image in your bitbucket-pipelines.yml file, [atlassian/default-image:latest](https://hub.docker.com/r/atlassian/default-image/) will be used. However, you can use any public and private Docker images including those hosted on Docker Hub, AWS, GCP, Azure, and self-hosted registries accessible on the internet.

With regards to AWS Opsworks, if the service provides a way to deploy from another machine via command line, it may be possible to do this in Pipelines by using the same commands in the script of your bitbucket-pipelines.yml file.

I would recommend looking into AWS Opsworks documentation or contacting their support team regarding how to deploy from another machine via command line. You could then test this first by deploying locally from your machine, and then by deploying from a Docker container on that machine, before configuring it in Pipelines.

You can use secured user-defined variables for storing any credentials that may be required for authentication:

<https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How can I leave a repository or workspace that I was invited to?
Asked by Eduardo Tavarez:

I was invited to several repositories in different workspaces with read access. I would like to leave or "revoke" access myself from these workspaces and repositories without having to ask the owner.


Answers:
author: Thuan_ Do Dang
body: Hi [@Eduardo Tavarez](/t5/user/viewprofilepage/user-id/4501159) ,

Please click to your avatar at the top right \> select **All workspace** \> select workspace that you want to leave \> click **Leave** at the right on workspace line.

About repository or project, I don't see any feature to leave or revoke access.

Hope this helps!

comments: author: Eduardo Tavarez
body: Thank you!


Tags: bitbucket-cloud

cloud
List and accepts repository invites with Bitbucket API v2
Asked by Eduardo Tavarez:

Is it possible to list and accept pending invites using Bitbucket's API? All the information I found so far about this points towards API v1 and when I try to use I get a message that it is no longer supported.


Answers:
author: Pramodh M
body: Hi [@Eduardo Tavarez](/t5/user/viewprofilepage/user-id/4501159)

The documentation of v2 API is <https://developer.atlassian.com/cloud/bitbucket/rest/intro/>

There is no listed API for accepting the invitation as of now

Thanks,  
Pramodh


Tags: api

bitbucket-cloud

cloud

rest-api
In a Python file, can I import something from a file in a completely separate repo?
Asked by Alexis Evans:

I have a method/function in a file in repo A, and I'm trying to import it in a file in repo B. So at the top of the file in repo B, I have:

from repo_A.folder.folder.File_name import Method

And then I call the method. Will this work, or is there a better way to get it to work?


Answers:
author: Erez Maadani
body: Python imports care about your directory structure. As long as the file is found in the given reference, the import will work.

The recommended approach is to keep your repo (or repos structure) aligned with the directory structure you need, so you can just clone/checkout once and build your project on any machine, including other developers' machines and CI machines.

If your repo_A is depended on repo_B, consider one of the following options:

1. Merge the repos into one.

2. Use git sub-module or sub-tree.

3. Include repo_B's artifact as a dependency in repo_A - download the binary from artifactory or other binary server. In this option the \`import\` will be a bit different.


Tags: bitbucket-server

server
How and where to turn off Bitbucket public repositories ?
Asked by MD:

How and where to turn off public repositories using "feature.public.access=false"? Does Bitbucket server service have to be stop to make the change?

thank you


Answers:
author: Bastian Stehmann
body: Hi [@MD](/t5/user/viewprofilepage/user-id/5001938) ,

You have to put that in the bitbucket.properties file in appdata/shared folder.

And you have to restart Bitbucket afterwards.


Tags: bitbucket-server

server
bit bucket pull request url shared via email points to localhost
Asked by AJ:

I couldn't find the settings where i can update the pull request url shared via email. Please advice on how to change the url link. Our bitbucket server path is hosted on a server (eg: [http://bitbucket..\*\*\*\*\*.\*\*\*\*\*\*.com/](http://bitbucket..*****.******.com/))

![bitbucket.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/213282i4FA4E338D195736F/image-size/large?v=v2&px=999 "bitbucket.PNG")


Answers:
author: Erez Maadani
body: This might help: [https://confluence.atlassian.com/bitbucketserver077/specifying-the-base-url-for-bitbucket-server-1026551743.html#:\~:text=To%20specify%20Bitbucket%20Server's%20base,Click%20Save](https://confluence.atlassian.com/bitbucketserver077/specifying-the-base-url-for-bitbucket-server-1026551743.html#:~:text=To%20specify%20Bitbucket%20Server's%20base,Click%20Save).


Tags: bitbucket-server

pull-request
Why does git fetch take forever to complete on Bitbucket only?
Asked by Clemens Himmer:

I have the problem where \`git fetch\` takes an enormous time to complete - *always* 13 minutes, and 9 seconds ? a few ms -, which does not happen on other git origins like e.g. Github repos - to eliminate issues caused by network. The consistent time taken to complete the operation makes me assume the establishing of the connection takes slightly over 13 minutes and the actual response is what makes the variation in completion time, but I have no idea what causes this.

This problem occured a few days ago, before fetch worked as usual, but there has been no significant event that would explain why this change in speed occured.  

I work with SSH, I have not tried using HTTPS yet because I work with SSH on all repos I contribute to.


Answers:
author: Erez Maadani
body: I suggest to start by changing your SSH debug level to more verbose. Depending on your git client version, you can use one of the following:

1. From Git version 2.3.0, you can use the environment variable `GIT_SSH_COMMAND` and pass the `-v` verbose argument:  

    GIT_SSH_COMMAND="ssh -v" git clone example

2. From Git version 2.10.0, you can save this configuration globally, or per repo:

    git config core.sshCommand "ssh -vvv"git pull

See original answer [here](https://askubuntu.com/questions/336907/really-verbose-way-to-test-git-connection-over-ssh)

comments: author: Clemens Himmer
body: Thanks, I was unaware you could do that!  
That pointed me into the right direction, which leads me to the problem of my network refusing connection to bitbucket's IPv6 addresses, documented here: <https://confluence.atlassian.com/bbkb/recent-ipv6-changes-840796883.html>  

I have solved the issue with the mentioned workaround, thanks a lot!


Tags: bitbucket-cloud

cloud
Someone has already added that key as an access key to a repository.
Asked by Fabien Rodriguez:

Hi,

I got this error

Someone has already added that key as an access key to a repository.

when trying to insert my public ssh key whereas no repositories of mine have my ssh-key inside access key menu


Answers:
author: Nic Brough -Adaptavist-
body: There's no easy way to work this out because the keys that belong to other accounts should not be shared.

If you shared the key with someone, you should know who. If you were given the key by someone, then you'll need to ask them.

If you have no luck chasing it down, you can raise a support request with Atlassian, and they can search out the key for you and hence identify the account you shared it with.

If you don't want to spend ages chasing down the share, then you can (and should) create a new key for your account and use that instead.


Tags: bitbucket-cloud

cloud
Need to understand about bit bucket pipeline
Asked by Kapil Bansal:

Hi Team,

This repository [bitbucket.org/kbansalapil/bathfitter/src/master/](https://bitbucket.org/kbansalapil/bathfitter/src/master/) was recently handover to us and we are not aware of how this deployment is going on with hooks that are configured on bitbucket. Actually, the old developer has been left and we have no idea where these hooks are getting used.

Can you please let us know where these hooks are used for deployment? Please assist because this is impacting our deployment.


Answers:
author: Ben
body: Hi Kapil,

Welcome to the Bitbucket Cloud Community!

The easiest way to check how webhooks are configured on a repository, is to access Repository Settings \> Webhooks.

This will list the webhooks currently configured, you can also click "Enable History" on the webhook to analyze the HTTP payloads that are being sent to whichever configured webhook endpoint has been implemented.

Hope this helps, let me know if you need further information.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
System downgrading to free plan
Asked by Manoj:

Hi - I have moved the plan from Free to Standard with 6 users. But the following day it moves me back to free plan. Also I cannot see an option to get a payment link for the 6 users. The payment option set for bitbucket requires an OTP to be input, so we need the manual payment option with link.

Any assistance would be appreciated.

Thanks,

Manoj


Answers:
author: Theodora Boudale
body: Hi [@Manoj](/t5/user/viewprofilepage/user-id/5018200),

Could you please reach out to our Customer Advocate team to request assistance if your billing plan gets downgraded automatically?

We need a ticket for this, we cannot resolve any billing issues in community.

You can create a ticket with the Customer Advocate team the following way:

1. Open this link <https://support.atlassian.com/contact/#/>
2. In "What can we help you with?" select "Billing, payments and pricing"
3. In "Select a topic" select "Problems with a payment or credit card"

Please make sure to give the URL to your Bitbucket Cloud workspace as well.

If you have any questions, please feel free to let me know.

Kind regards,  
Theodora


author: Pramodh M
body: Hi [@Manoj](/t5/user/viewprofilepage/user-id/5018200)

Welcome to the Community!!

Add the billing details here and then you can activate the plan

<https://bitbucket.org/account/user/>\<workspace-name\>/billing-details

Let me know if it helps

Thanks,  
Pramodh

comments: author: Manoj
body: Hi [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) - That is already in place.


Tags: bitbucket-cloud

cloud
bitbucket pipeline - Do steps run on a docker container even in self.hosted windows runners?
Asked by Giuliano Motter:

Hello all,

I might be missing some basic piece of info. but I have what sounds to me like a really simple question...

Documentation about bitbucket pipelines says very explicitly that: "*Each step in your pipeline runs a separate Docker container.*"

1. Is this the case even for self.hosted windows runners? It looks like to me that my steps are running on a simple powershell instance on my runner, and not inside any docker container.
2. If it's not in fact running inside any docker container currently. Is is possible to do so on a self.hosted windows runner?


Answers:
author: Ben
body: Hey Giuliano,

Welcome to the Bitbucket Cloud Community! :)

You are correct - Windows Runners do not run within a Docker container, the documentation specifying "*Each step in your pipeline runs a separate Docker container.* " applies to Bitbucket Pipelines itself rather than the Runner component.

Unfortunately, it is not possible to run a self hosted Windows runner within a Docker environment (also known as a Docker-in-Docker Image), this is listed under "Unsupported Features":  
<https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/>  

Hope this helps.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

bitbucket-pipelines

bitbucket-runners

cloud

docker

windows
Validate code before push to Bitbucket
Asked by Syed Adil:

Hi Team,

Could any help me understand if there is a way we can intercept/validate code before pushing to Bitbucket other than using Hooks?

Thanks,

Syed Adil Shariq.


Answers:
author: Pramodh M
body: [@Syed Adil](/t5/user/viewprofilepage/user-id/5017911)

Welcome to the community ?

Pre-recieve hooks are the only way.

With this there is Git Hooks

Here's a reference

<https://gofore.com/en/automate-validating-code-changes-with-git-hooks/>

Thanks,

Pramodh

comments: author: Ulrich Kuhnhardt _IzymesCo_
body: At the moment you will need to rely on local git pre-receive hooks as pointed out by [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) . There is an open feature request for Bitbucket cloud <https://jira.atlassian.com/browse/BCLOUD-10471> to enforce hooks remotely.

Please vote to signal to Atlassian that this is a much needed feature.

Best, Ulrich

// [Izymes](https://marketplace.atlassian.com/vendors/1210584/izymes-pty-ltd)


Tags: bitbucket-cloud

cloud

git
How to Clone (or Checkout) a Specific Branch via Visual Studio 2022
Asked by Ardeun:

I think the title pretty much says it all.

I can Clone the full repo but I cannot seem to select the specific Branch I want.

Simply put I just want to do a Fetch. I do not want to do this via the console, but rather within VS via the UI.

Possible ?

Thanks in advance.


Answers:
author: Pramodh M
body: Hi [@Ardeun](/t5/user/viewprofilepage/user-id/2184769)

I have not tried this, but you can explore the option of specifying the branch URL and see if it's cloning the branch

Heres the reference

<https://github.com/microsoft/vscode-remote-release/issues/4296>

Otherwise clone the repo with shallow option and then checkout to a specific branch which is optimal for large repositories

Let me know if this helps

Thanks,

Pramodh

comments: author: Ardeun
body: Appreciate the reply Pramodh,

I read the github link however on my interpretation it does not address the issue for me.

I will try that second option you mentioned. While it does sound workable it is of course not ideal as it is double handling and if I am not mistaken (happy to be corrected) I will end up with two sets of files on my drive ?

Cheers


Tags: bitbucket-cloud

cloud
How to deploy BitBucket download artifact to my home server (ubuntu)
Asked by Mike Bernal:

I have a NestJS app with Postgres running using docker-composer. I am new to BitBucket and trying to figure out how to deploy my BitBucket download artifact to my home server. So far I have:

1. written a bitbucket-pipelines.yml
2. Up and running runner
3. Add SSH keys

Anyone can point me to the right directions? I would really appreciate it. Thanks

image: docker/compose  
options:  
docker: true

pipelines:  
default:  
- step:  
name: 'Build images'  
runs-on:  
- self.hosted  
- linux  
script:  
- docker-compose down  
- docker-compose build  
artifacts:  
- ./  
services:  
- docker  
- step:  
name: Deploy to staging  
deployment: Staging  
artifacts:  
download: 'true'  
trigger: 'manual'  
script:  
- docker-compose up -d  
- docker-compose ps


Answers:
author: Pramodh M
body: Hi [@Mike Bernal](/t5/user/viewprofilepage/user-id/5017602)

Welcome to the community ?

Have you tried manually running commands in runner once with the docker-compose and curl command?

Also store the artifacts in separate folder by creating one

Pipeline looks correct syntactically.

Try once and see if it succeeds

Thanks

comments: author: Mike Bernal
body: During the **step: Build images**my VM runs these containers:

![ds.png](https://community.atlassian.com/t5/image/serverpage/image-id/213140iEDE9B13925F4B488/image-size/large?v=v2&px=999 "ds.png")

Then in deployment step, it stops and removes these containers.

and display an error:

![curl.png](https://community.atlassian.com/t5/image/serverpage/image-id/213144i4FFA2F80D7535343/image-size/large?v=v2&px=999 "curl.png")

it doesn't create a directory to my vm.


author: Pramodh M
body: [@Mike Bernal](/t5/user/viewprofilepage/user-id/5017602)

Have you tried manaully testing the script?

and try it with creating a folder for artifact


author: Mike Bernal
body: Sorry but how do I manually test the script and create a folder for the artifact?

The program works fine if I clone my bitbucket repo inside the vm without the pipelines.


author: Pramodh M
body: [@Mike Bernal](/t5/user/viewprofilepage/user-id/5017602)

Manually in the sense test the commands in linux server

creating the folder would be refering it has ./artifact/ after creating the folder


author: Mike Bernal
body: Can you show me how to do it by editing the above .yml if you don't mind.

I am using docker-compose to run my services to my own server. What is happening was ithe docker images is successully building and running in the pipelines however, how can I run it instead in my server through the runner? It is not doing it's purpose.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Best practice to sync only specific files from repositories
Asked by Alexander Maier:

Hello,  

I have access to 10 different repositories from our Dev team. From each of the repository I need only one specific file. Each specific file from the repositories will be used by team members or tools who are not allowed to have access to those 10 repositories.  

Therefore I'm planning to create another repository which contains each specific file from the 10 repositories. This way it's easier to provide access to these files to team members and tools.  

My problem is that these files have to be always up-to-date. If one of the files was updated in one of the 10 repositories it also needs to be automatically updated in my repository.

I wanted to ask what the best practice is to make this process work?

I'm grateful for any advice. Thank you!

Best,  
Alexander


Answers:
author: Erez Maadani
body: That depends on the required access level (read/write/delete), your technology stack and use cases (for example, what happens if one of the files is updated while a user reads it).

For the most simple case, if the systems/users just need read access and you don't care about updates during read, you can use either:

1. Third parties like BitBucket pipelines or ArgoCD, to listen to changes and update the dedicated repo.

2. Have a small service which only returns the specific files directly from BitBucket. See here for a simple CURL example: <https://community.atlassian.com/t5/Bitbucket-questions/How-to-download-a-file-from-bitbucket-downloads-during-pipelines/qaq-p/1859283>.

3\*. This one is more cumbersome but it eliminates the file duplication so I'm putting it here - use submodule or sub-tree. See here:<https://community.atlassian.com/t5/Bitbucket-questions/How-to-add-a-subrepository/qaq-p/778446>


Tags: bitbucket-cloud

cloud
Will you still see change diffs on previous PR after branch merged, but not deleted?
Asked by jianbai-wang:

Hello experts,

I would like to know if I merge my branch after Pull Request reviews and approval, but not delete the branch, and create a new PR for new changes on the same branch, will the diffs in the previous PR be accumulated in the new one?

Thanks for any responses.

Jim


Answers:
author: jianbai-wang
body: BTW, I don't want them to be accumulated and I assume diffs are associated with one PR only. Otherwise it looks messy. Just want to double check.

comments: author: Patrik S
body: Hello [@jianbai-wang](/t5/user/viewprofilepage/user-id/3404377) ,

Thank you for reaching out to Atlassian Community.

The PR diffs are calculated by comparing the code between the source branch the and destination branch. So if you create a second Pull Request from the same source branch and to the same destination branch, it will only show the new changes and not the previously merged changes.

Hope that helps to address your questions.

Thank you, [@jianbai-wang](/t5/user/viewprofilepage/user-id/3404377) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

cloud
error: failed to push some refs
Asked by Chris Obi:

please, can some body help with solution to this.

error: src refspec master does not match any  
error: failed to push some refs to ....


Answers:
author: Ben
body: Hey Chris,

Welcome to the Bitbucket Cloud community! :)

So that I can assist you with this issue, can you confirm if this error message is occurring for other repositories? Can you also please confirm if you are connecting via SSH or HTTPS?

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Could not push large file (200MB) into bitbucket server.
Asked by Jithinraj Kp:

Using http connection, no ssh option available

Tried increasing the post buffer size, but no progress

Able to push smaller files.

$ git push origin  
Enumerating objects: 24, done.  
Counting objects: 100% (24/24), done.  
Delta compression using up to 2 threads  
Compressing objects: 100% (8/8), done.  
Writing objects: 100% (13/13), 199.47 MiB \| 5.22 MiB/s, done.  
Total 13 (delta 4), reused 0 (delta 0)  
error: RPC failed; curl 56 OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 10054  
fatal: the remote end hung up unexpectedly  
fatal: the remote end hung up unexpectedly  
Everything up-to-date


Answers:
author: Pramodh M
body: Hi [@Jithinraj Kp](/t5/user/viewprofilepage/user-id/5016962)

Welcome to the Community!!

You can try below methods to mitigate the error

* Try tracking the file via Git LFS - <https://support.atlassian.com/bitbucket-cloud/docs/use-git-lfs-with-bitbucket>
* Once you have tracked the file via Git LFS use SSH to push the Code to Remote

Thanks,  
Pramodh


author: Jithinraj Kp
body: Thank you [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) for the prompt response.

We have enabled Git lfs for the repo on Bitbucket and tried the steps mentioned in Link you shared above, But we are still getting below error.

$ git push origin  
Uploading LFS objects: 0% (0/1), 620 MB \| 12 MB/s, done  
LFS: Put <https://devtools.companyname.com/bitbucket/rest/git-lfs/storage/EAIXYZ/repo-name/dbf2d00193972da1172bf6a5a6dc14e4ed860fbaa0a1f8a7faffe46fd45cc112>: read tcp 10.XX.XXX.XX:58255-\>10.X.XX.X:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

<br />

error: failed to push some refs to '<https://devtools.companyname.com/bitbucket/scm/EAIXYZ/repo-name.git>'

comments: author: Vishal Kharde
body: hi [@Jithinraj Kp](/t5/user/viewprofilepage/user-id/5016962) did you find any resolution for this issue? I m facing same error.


Tags: bitbucket-cloud

cloud