So I have an application that contains an ASP.NET Core backend and a React frontend (pure static).
In our TFS 2018, we have created a Build that does the following:
- Get sources from the repo
- Get Nuget packages (backend)
- Build the backend
- Run backend tests
- Get NPM packages (frontend)
- Build the frontend
- Run frontend tests
- Generate and publish artifacts
Then, a Release pickups those artifacts and deploy them to an Azure AppService (backend) and an Azure Storage v2 account (frontend).
We currently have only one environment, but we need to support multiple ones. The problem is that the frontend build depends on some environment variables which are not present during the build stage. The build doesn't know where is it going to be deployed yet.
So there are a few options here:
- Generate the frontend build in a Release. This needs a way for the Release to get access to the sources, either via Git or by getting it from an artifact. Latest is really slow because of all the npm_modules.
- Build should produce builds artifacts for all posible environments and each Release environment will pick up the proper one.
What's the recommended approach to handle this on TFS 2018?