Uploaded image for project: 'Bitbucket Cloud'
  1. Bitbucket Cloud
  2. BCLOUD-18269

[Request Bitbucket Pipeline] Switch Environmental Variable values based on Branch

    XMLWordPrintable

    Details

    • Feedback Policy:

      Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Description

      Hi there,

      I have a request regarding Bitbucket Pipelines.

      If I push to branch-A, I want to run tests using branch-A envs.

      If I push to branch-B, I want to run tests using branch-B envs.

      I have tried the following but it would revert the env to whatever env I set from the Repository Envs.

      Test

      Prerequisite

      • Repository Env already has MY_ENV=hello

      branch A

      • step1: MY_ENV=world
      • step2: echo $MY_ENV (result: hello)

      Conclusion

      Basically on a new step, whatever ENV I set in the previous step gets reset. I will create an issue in the public issue tracker.

      Right now what I am doing is creating duplicate steps that all do the same thing (build, test) but just changes the ENV in the beginning, which isn't a huge issue. It just would be nice to be able to reuse steps instead and just switch out the env.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            alex.wong1 alexwonguhuru
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: