Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to override default variable in bitbucket pipeline

Deleted user April 6, 2022

Hello community,

I want to override default value for BITBUCKET_CLONE_DIR in bitbucket pipeline. I have tried the below approach to override it. But it doesn't work. any suggestion please?

Thanks in advance.

steps:
  - step: &run-tests
      name: run_unit
      script:
         - export BITBUCKET_CLONE_DIR='/host/xxxx'

1 answer

1 vote
Caroline R
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2022

Hi, @[deleted], thank you for reaching out to Atlassian Community.

I tested overriding the default variable BITBUCKET_CLONE_DIR on a personal repository using the same command you shared here and it worked for me. Could you please confirm what is the error message you receive?

You can also override a default variable by specifying a variable with the same name in the repository or workspace level. To access and configure a repository variable, you need to be an admin of that repository.

  • You can manage repository variables in Repository settings > Pipelines > Repository variables

  • If you want to set a variable in the workspace level, you can follow the next steps: 

  1. From your avatar, select a workspace. 

  2. Select Settings on the left navigation sidebar to open your Workspace settings. 

  3. In the menu on the left, go to  Pipelines > Workspace variables

In case you would like to read more about variables and secrets, you can access the following doc: 

Please feel free to share any additional information regarding this case.

Kind regards,
Caroline

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events