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 ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.