Here are things I want to do with Bitbucket pipelines:
- I had written a bitbucket pipeline to deploy multiple environments for one of my react app, in which the first environment/stage deployment will be auto, else I have to do it manually. But the build for code will be generated only once for the first step, for the rest of all steps, it should have to use the same old generated build.
- Now, each environment has different config variables such as API URLs or other creds. And as I mentioned that build will generate only once, so identification env variable, I can set only once before build generate
- Suppose: REACT_APP_ENV=dev npm run build
This is my scenario, now my question is that how can we set the env variable dynamically on each step without creating a new build?
Or is there any way to set the env variable in the Bitbucket site and access in code dynamically so I can manage through that.
Else create a new build for each environment is the last option for me.