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

Can we store a file as secret in bitbucket, where all the secret variables could be defined ?

Shishir Mathur
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 20, 2023

As per what's mentioned in the doc -

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

There is no way mentioned to store all the secret variables in a single file and then expose that file altogether to the pipeline.

Defining each variable as a separate secrets means we need to update the pipeline script every time a new variable is added. However, if there were a file to hold all the secrets and dynamically expose all those secret variables, we won't need to update the script every time a new variable is added.

FWIW, this is similar to to what is followed in case of Flutter -

Individually defining each variable -

--dart-define=someVariable=someValue --dart-define=otherVariable=otherValue --dart-define=thirdVariable=thirdValue

 VS

Defining them all in one file -

--dart-define-from-file=<use-define-config.json>

 So, is there a way to achieve the similar thing (to dart-define-from-file) in bitbucket secrets ?

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 22, 2023

Hi Shishir and welcome to the community!

I'm afraid that this is not possible at the moment.

You mention the following:

Defining each variable as a separate secrets means we need to update the pipeline script every time a new variable is added. However, if there were a file to hold all the secrets and dynamically expose all those secret variables, we won't need to update the script every time a new variable is added.

I don't understand how using a file to hold all secrets would eliminate the need to edit the pipeline script. Even if the secret file solution were possible, wouldn't you still need to edit the pipeline script to reference the new variable? Could you please clarify what you mean, perhaps with an example?

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events