问题
We have a creat-react-app application, which includes a couple of variables that are different (react) build time, depending on where the build will be deployed. For example, we need to specify build time which URL will be used, e.g. https://app-stage.company.com for a release-x.y.z
build vs. https://app.company.com for a master
build (please refer to this article about GitFlow). We've already created such a build pipeline as suggested here, which will build with the appropriate react config for any commit to branches master
, release-x.y.z
, dev
, hotfix-x.y.z
.
We would like to create a release pipeline now, that reflects the GitFlow process and makes use of the automated builds.
The release pipeline should deploy to a dev site for a dev
build, to a stage site for a release-x.y.z
build, etc. I know I can inspect the source branch from a build and filter/modify config/variables based on it. Fine, so I can create a release pipeline with a single stage, whose config is modified on the fly based on which source branch was built.
But I understand that release pipelines "should" have a series of stages, i.e. dev -> stage -> production, probably with approvals inbetween. I can't see how this could be achieved in this scenario.
Suggestions?
Our idea as of now is to just have that single modified-on-the-fly stage in the release pipe and handle the stages from git merges/pull requests, according to GitFlow.
来源:https://stackoverflow.com/questions/54251289/azure-devops-release-pipeline-for-create-react-app-and-gitflow