youngmon/atlassian-qna huggingface dataset:
How to pass variables in bitbucket pipelines
Asked by sschroders:

I am building a pipeline to deploy my .net projects. in my solution I have several azure functions all under same repo. I want to zip and deploy them. I want to reuse my zip script and therefore I have put it in a step. however to path to which files it needs to zip is different per function (.net code). how can i use variables to set the path as part of my pipeline step?


Answers:
author: Aron Gombas _Midori_
body: Bitbucket has dedicated support for repository (and even workspace!) variables.

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

comments: author: sschroders
body: [@Aron Gombas _Midori_](/t5/user/viewprofilepage/user-id/502447) thanks for your help I have seen this page but I still don't see how I can define and use the variables in the ymal? I need to overwrite the value of the variable in different steps. but everything I have tried my variable's value is not changed. any idea how can i do this. perhaps an example. I really appreciate this


author: Theodora Boudale
body: Hi [@sschroders](/t5/user/viewprofilepage/user-id/4412281),

If you have a Repository, Workspace, or Deployment variable named **MyVar** , you can reference it in the bitbucket-pipelines.yml file as **$MyVar** (except if you use a Widnows self-hosted runner for your Pipelines builds, in which case you will need to reference it as **$env:MyVar**).

For example, the following pipeline will print the value of the variable named MyVar:

```
image: atlassian/default-image:4

pipelines:
  default:
    - step:
        name: 'First Step'
        script:
          - echo $MyVar
```

If you want to change the value of the variable in a second step, you can do it as follows:

```
image: atlassian/default-image:4

pipelines:
  default:
    - step:
        name: 'First step'
        script:
          - echo $MyVar
    - step:
        name: 'Second step'
        script:
          - MyVar="some other value"
          - echo $MyVar
```

Please keep in mind that this will change the value of the variable only in this second step. If you have a third step, it will read the value of the variable from Repository, Workspace, or Deployment variables, so it will have the original value.

If the different steps that use this variable are [deployment](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-monitor-deployments/) steps (with the use of the **deployment** keyword), you can then create a variable named **MyVar** in every deployment environment that uses it and give it a different value for each environment (no need to change the value in the yml file).

Please feel free to reach out if you have any questions!

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Problem access Bitbucket Repo
Asked by Flavio Audino:

Hi There,

I got invited to access the bitbucket workspace. i am the org admin i cant access to the repository anymore since i disabled (i guess?) the user account of the owner of the space who left the company. can you please advise on this. we urgently need access to the workspace.

thx!


Answers:
author: Syahrul
body: Hey [@Flavio Audino](/t5/user/viewprofilepage/user-id/5497645)

It looks like the issue with the support ticket you've created has been resolved. Feel free to update the ticket or raise a new one with us if you have any further issues.

Regards,  
Syahrul


Tags: bitbucket-cloud

cloud
How to get the source branch of the latest merged PR?
Asked by swetha ramakrishnan:

I trigger a jenkins build from master when a PR is merged to my master branch. And i have few post actions to be done after my build for which i need the source branch of the latest merged PR to master. Could you help me with the steps on how to get this data.


Answers:
author: Mark C
body: Hi [@swetha ramakrishnan](/t5/user/viewprofilepage/user-id/5497676),

Welcome to the community.

This information can be obtained by using the REST API endpoint below, querying the source branch, and sorting it based on the updated date.

```
/repositories/{workspace}/{repo_slug}/pullrequests
```

API Reference: [List pull requests](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get)  
Querying and Sorting reference: [Filter and sort API objects](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#filtering)

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
The APIs in the "Users" section always return error
Asked by Ritesh.Hiremath:

I am trying to access the REST APIs that fetch the "Users" information. For Eg: <https://api.bitbucket.org/2.0/user> . This GET request always gives me an error - "  
Token is invalid or not supported for this endpoint." The same issue when I try to fetch UUID of any user using the "Nickname" as parameter. Is this a permissions issue?


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

The endpoint <https://api.bitbucket.org/2.0/user> will return the currently logged-in user based on the authentication method you are using. This will work if you use a username and app password, for example, but it will not work with a repository access token.

Can you please let me know which authentication method you are using for this API call from the ones listed on this page?

* <https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication>

In case you use OAuth, which grant flow are you using to obtain an access token?

> The same issue when I try to fetch UUID of any user using the "Nickname" as parameter.

The nickname is not unique and it can't be used with the following API endpoint:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get>

You will need to use the UUID of the Bitbucket user enclosed in curly brackets. Please keep in mind you may need to escape the curly brackets, so use **%7B** instead of **{** and **%7D** instead of **}**.

For example, for a user with UUID 280g0f52-6832-9a31-f7er-488219b3e826 you would need to use

```
https://api.bitbucket.org/2.0/users/%7B280g0f52-6832-9a31-f7er-488219b3e826%7D
```

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Step-by-Step Guide Deploying an Application from Bitbucket to AWS EC2 Using Bitbucket Pipeline
Asked by Muhammad Muzammil:

The reason we can't deploy the application directly from Bitbucket is that it brings a lot of problems and there are no suitable plugins available. Therefore, we have to rely on AWS CodeDeploy to deploy the source code to EC2 instances.

tell me how to deploy application from bitbucket on aws ec2 using bitbucket pipeline?

tell me step by step


Answers:
author: Patrik S
body: Hello [@Muhammad Muzammil](/t5/user/viewprofilepage/user-id/5497242) ,

and welcome to the Community!

I found the following article which contains details steps on how to implement a bitbucket pipeline to deploy on AWS that may be of help:

* <https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-aws-with-codedeploy/>

I'd suggest going through the steps in that article, and If you have any questions or face any errors during the configuration, feel free to ask here.

Thank you, [@Muhammad Muzammil](/t5/user/viewprofilepage/user-id/5497242) !

Patrik S


Tags: aws

bitbucket-cloud

bitbucket-pipelines

cloud

code-deploy

pipes
Step stuck and not proceeding with after-script
Asked by C.Yeow:

Please advise why the step will not proceeding to after script phrase occasionally. It just stuck there and terminate after default 2 hours time out.

Pipeline that had issue![Screenshot_20240514_180725_Chrome.jpg](/t5/image/serverpage/image-id/323540i54DEAABCE75F5174/image-size/large?v=v2&px=999 "Screenshot_20240514_180725_Chrome.jpg")Expected behaviour![Screenshot_20240514_180004_Chrome.jpg](/t5/image/serverpage/image-id/323538i611CC4650FD69EC8/image-size/large?v=v2&px=999 "Screenshot_20240514_180004_Chrome.jpg")

Regards,

Chong


Answers:
author: Ben
body: Hi C_Yeow,

I can see that you have access to a Premium workspace, and therefore you are entitled to Premium support directly from our support team.

We will need to access your workspace to assist you further - which requires a support ticket. I have opened one on your behalf - please check your email inbox for this.

In future, you can raise a support ticket directly with our support team by entering your company workspace in the following format **"bitbucket.org/workspaceID"** and selecting **Bitbucket Cloud** as the product with **Technical Issues \& Bugs**as the issue type:

* <https://support.atlassian.com/contact/>

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
Git push capacity limit issue
Asked by ethan:

Thank you for reading my message.

I am currently attempting to migrate from SVN to Bitbucket Git. I have synced the files and history from SVN to Git SVN, and now I only need to push to Bitbucket Git.

I ran the following command but encountered the following error:

$ git push origin master

Enumerating objects: 73586, done.

Counting objects: 100% (73586/73586), done.

Delta compression using up to 22 threads Compressing objects: 100% (23649/23649), done.

Writing objects: 100% (73586/73586), 346.77 MiB \| 21.76 MiB/s, done.

Total 73586 (delta 44482), reused 69545 (delta 41356), pack-reused 0 (from 0) remote: Resolving deltas: 100% (44482/44482), done.

remote: Your push has been blocked because it includes at least one file that is 100 MB or larger. Bitbucket Cloud recommends using Git LFS for large files to prevent repositories from growing too large and reaching the 4 GB repo size limit. Learn more about Git LFS at <https://support.atlassian.com/bitbucket-cloud/docs/manage-large-files-with-git-large-file-storage-lfs/>. If necessary, the file size limit can be disabled by an admin in Repository settings. Learn more at <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Avoid-adding-large-files>.

The current project size is 2.23GB.

I would like to temporarily disable the push size limit.

Could you please provide a solution to this issue?


Answers:
author: Emxm3
body: The answer is in the links you provided in the question   

By the sounds of things you are the repository owner.

1. From the repository, select Repository settings in the left sidebar.
2. Select the Advanced dropdown to display the Advanced settings.
3. Enable or disable the limit using the Block pushes with files over 100 MB toggle
4. Select Save changes.


Tags: bitbucket-cloud

cloud
Requesting Additional Space as an Educational User
Asked by Malia Paffenroth:

Hello, I am an educational user using BitBucket for a video game development course with my university. My professor suggested reaching out to Atlassian Technical Support to "request additional space in case we need it later." Since there does not appear to be any way to reach out to Tech Support directly without paying, I have, frustratingly, been forced to post instead.


Answers:
author: Patrik S
body: Hey [@Malia Paffenroth](/t5/user/viewprofilepage/user-id/5496233) ,

and welcome to the Community!

To apply for an academic license you will need to submit a formal request through our system including all of the details of your university:

* <https://www.atlassian.com/solutions/survey/academic-license-request#/>

Thank you!

comments: author: Malia Paffenroth
body: We were required to apply for the academic license last term, so I applied for it about seven weeks ago and it was approved. Do I need to have it approved for each project/repository?


author: Patrik S
body: Hey [@Malia Paffenroth](/t5/user/viewprofilepage/user-id/5496233) ,

Checking internally, I see you have access to two workspaces, with one of them having the Academic license, while the other is on the Free plan.

The academic license is tied to the workspace (not project/repository). You can have multiple projects/repositories under a workspace, and if that workspace has academic license, all the project/repos under that workspace will benefit of that plan.

However, if you are creating repos in the workspace that has the Free plan and want the benefits of Academic license, you will need to request the academic license for that workspace as well.

That being said, when you mentioned "Requesting Additional Space," could you please clarify what space you are referring to? Is it the repository size limit?


author: Malia Paffenroth
body: I copied and pasted her words exactly, but I am assuming that she is referring to repository size limit.

Thank you for all of your responses, I have gone ahead and requested an academic license for the new workspace.


Tags: bitbucket-cloud

cloud
Deploy variable value in PowerShell
Asked by Dmitriy Kagarlickij:

I need value that user entered on the pipeline start to be used in the pipeline,

Pipeline is running on self-hosted windows agent and I need value to be used in PowerShell

My pipeline looks like this -

\`\`\`  
pipelines:  
custom:  
deploy:  
- variables:  
- name: myVar  
- step:  
runs-on:  
- windows  
- self.hosted  
script:  
- Write-Output "myVar = $env:myVar"

\`\`\`

I enter \`myValue\` on pipeline run, but Write-Output displays \`myVar = **true**\` instead of \`myVar = myValue\`

If I use built-in variables, e.g. \`Write-Output "myVar = $env:BITBUCKET_BUILD_NUMBER"\` output is with correct value (\`myVar = 22\`)

So how can I get the value that user entered on pipeline start?


Answers:
author: Patrik S
body: Hello [@Dmitriy Kagarlickij](/t5/user/viewprofilepage/user-id/5275566) ,

thank you for reaching out to Community!

The custom variables provided on the pipeline start should also work on Windows Runners with no required additional configuration.

I was able to confirm that in my test environment with Windows runners, where the variable provided was correctly printed in the logs with the value put at the pipeline start.

In this case, to confirm if the variable is being passed to the build, could you expand the ++Build Setup++ section on the logs, and look for the session named *Pipeline variables* ? That section will contain all the custom variables provided to the pipeline :

![Screenshot 2024-05-14 at 3.50.19?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/323660i013AE379403F0E2A/image-dimensions/200x35?v=v2 "Screenshot 2024-05-14 at 3.50.19?PM.png")

In the example above, I had a variable named **myVar** and provided the value "**testingValue**" when triggering the pipeline.

Could you verify if your pipeline has a similar log?


Tags: bitbucket-cloud

cloud
CODEOWNERS not working with teams,yaml
Asked by Ludwig OHallorans:

Hi,

I'm trying to implement code owners functionality in our repositories.

I got one to test, removed the configured default reviewers in bitbucket, and added both files to the .bitbucket folder in the root of the repository. I commit the changes and can see the folder and the files in development branch, but when a PR is requested from any branch to development the configuration in CODEOWNERS is not used.

Can anyone help me here please?

Note: the space between @ and teams I need to add it because the forum insisted in placing an User link there, In my file there is no space between the @ and teams.

CODEOWNERS file:

# User @ teams to prefix your team name and let CODEOWNERS know to look in  
# your teams.yaml file

# For Client changes designTeam need to be as default PR  
# accompanied by 2 of the webTeam  
\* @ teams/designteam @ teams/webteam

# It can be useful to setup a "meta-owner" that is responsible for changes to the  
# teams and CODEOWNERS files  
.bitbucket/\* some.name@subdomain.domain

teams.yaml file:

webTeam: # Name of the Team  
contributors: # Array of contributors by email address  
- some.name1@subdomain.domain  
- some.name2@subdomain.domain  
- some.name3@subdomain.domain  
- some.name4@subdomain.domain  
- some.name5@subdomain.domain  
reviews: # Configuration for selecting PR reviewers  
strategy: least_busy # Reverse sort by # of open PR's they are reviewing  
select: 2 # and select the top 2 contributors  
designTeam:  
contributors:  
- some.name@subdomain.domain  
reviews:  
strategy: all # Select all users, no filtering/sorting applied  
mobileTeam:  
contributors:  
- some.name6@subdomain.domain  
- some.name7@subdomain.domain  
- some.name8@subdomain.domain  
reviews:  
strategy: all


Answers:
author: Patrik S
body: Hello [@Ludwig OHallorans](/t5/user/viewprofilepage/user-id/4982336) and welcome to the Community!

By checking your CODEOWNERS and teams.yaml file you shared, I see the group names were defined using camel case in the teams file, while in the CODEOWNERS, you refer to all the groups in lowercase. This is the reason why Bitbucket is not finding a match, as the team names are case-sensitive.

Could you edit those files to match the case and try to test opening a pull request again?

Thank you [@Ludwig OHallorans](/t5/user/viewprofilepage/user-id/4982336) !

Patrik S

comments: author: Ludwig OHallorans
body: I did it like that following the example Atlassian put in the setup article.

Thank you.

I will modify and test.

And share my results.


author: Ludwig OHallorans
body: It worked perfectly.

Thank you.


author: Patrik S
body: Awesome [@Ludwig OHallorans](/t5/user/viewprofilepage/user-id/4982336) ! Happy to hear that it worked :)

We have also updated the [Set up and use code owners](https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/) documentation to include the matching case in the provided example.

Feel free to reach out to the community if you ever need help!

Patrik S


Tags: bitbucket-cloud

cloud
Purpose and valid values for key "triggerIds" in a REST call to "Create/update a hook script"
Asked by landro:

I use the following REST call to create a repository hook, which works fine. <https://developer.atlassian.com/server/bitbucket/rest/v810/api-group-repository/#api-api-latest-projects-projectkey-repos-repositorieslug-hook-scripts-scriptid-put>

<br />

I couldn't figure out what effect the list of strings has on the repository hook.   
"triggerIds": \[ "\<string\>" \]  
Apparently this has no effect at all as the result is the same regardless of the strings I use. Each time you execute a push, the hook is executed.


Answers:
author: Jimmy Lowe
body: No answer but have the exact same question. We have a pre-commit hook that is firing on merges which isn't desired and wondering if triggerid's might be the most correct way to get the hook to only execute on a regular commit.


Tags: bitbucket-data-center

data-center

repository-hook

rest-api
Migrate for cloud
Asked by J?rn Schj?tler:

We are considering migrating to your Cloud solution for Bitbucket. In this connection, I must make sure that you comply with EU rules that our data is kept on a server in the EU.


Answers:
author: Valeriia_Havrylenko_SaaSJet
body: Hi [@J?rn Schj?tler](/t5/user/viewprofilepage/user-id/5495667) and welcome to the community!

This is something that Atlassian is considering, however I'm afraid that is no any ETA to share.

You can join to feature request for this in issue tracker:

* <https://jira.atlassian.com/browse/BCLOUD-20038>

I would suggest adding your vote there (by selecting the **Vote for this issue** link) and add yourself as a watcher (by selecting the **Start watching this issue** link), if you'd like to get notified on updates. When there is an update, one of our product managers is going to post in this public ticket.

Kind regards


Tags: bitbucket-cloud

cloud
remote? Invalid credentials
Asked by ???:

???? 'wheelchair'...  
"[https://heqiyouhqy@bitbucket.org"????](https://heqiyouhqy@bitbucket.org?????)  
remote? Invalid credentials  
fatal? '<https://bitbucket.org/rrlab-dlut/wheelchair.git/>' ????


Answers:
author: Patrik S
body: Hey [@???](/t5/user/viewprofilepage/user-id/5494806) , and welcome to the Community!

Based on the error message, you're likely using your account password (the one you use to log in to the bitbucket website) to authenticate the git operation, which is causing the authentication to fail.

For git operations, when prompted for the password, you should provide an [app password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) instead.

In this case, could you try [creating an app password](https://support.atlassian.com/bitbucket-cloud/docs/create-an-app-password/) and then provide it when git prompts for the password?

Thank you, [@???](/t5/user/viewprofilepage/user-id/5494806) !

Patrik S


Tags: bitbucket-cloud

cloud
Unable to upload flutter app to testflight or app-store using bitbucket pipeline.
Asked by deepak:

I'm reaching out regarding an issue I'm encountering while attempting to deploy my application to the app store using Bitbucket Pipeline.

To provide some context, I've developed a tool similar to "median.co" and "appmysite.com" that facilitates the conversion of websites into applications, complete with various widgets and functionalities. I've successfully created the application using a Bitbucket Pipeline script, and the script runs smoothly.

Now, my objective is to deploy the application to the app store solely through Bitbucket Pipeline. I'm seeking guidance on how to achieve this seamlessly within the Bitbucket environment.


Answers:
author: Patrik S
body: Hey [@deepak](/t5/user/viewprofilepage/user-id/5495612) ,

welcome to the Community!

While I'm not really familiar with the app store deployment/development cycle, I did some research and found the following medium article which talks about deploying a flutter app from Bitbucket Pipelines :

* [Flutter --- iOS App Release on AppStore using Bitbucket Pipeline.](https://medium.com/@parthg500/flutter-ios-app-release-on-appstore-using-bitbucket-pipeline-255a0b6c0976)

This article provides detailed instructions and examples of pipeline YML files, so hopefully it will be of help.

Thank you, [@deepak](/t5/user/viewprofilepage/user-id/5495612) !

Patrik S


Tags: bitbucket-cloud

cloud
Is it possible for an admin to take control of a review in Crucible?
Asked by Joseph Bruni:

Due to some turn-over, some reviews are not being closed and there appears to be no way to join the review. Is there some sort of back-door way for an admin to keep the review list cleared?


Answers:
author: Marek Parfianowicz
body: Please have a look at Administration \> Security Settings \> Permission Schemes. Here you will find which users/groups are allowed to close a review.

Also, look at Project Settings \> Projects \> (project key) \> Permission scheme to find out which permission scheme is used in the project.


Tags: fisheye-crucible-administration