Best CI/CD practice to build React Native app to multiple environments

Viewed 367

We have a react native Android App and we're using Gitlab for the CI/CD. Before deploying to production, there are several others environments (4 actually).

The app contains .env files for each environments:

  • .env.develop
  • .env.staging
  • .env.production
  • ...

Today, we are building (with gradlew) an APK for each environment with the corresponding .env file.

The builds are quite long are I'm looking for a way to optimize the CI/CD.

Is it possible to build an apk independent of the environment, then adding the configuration file? This way, there is only one build left and the same core apk is used through all environments.

Or maybe we need to build an apk containing the configuration of ALL the environments, and the application have to choose the right one at run time?

Today, the developers are loosing some time waiting for the pipeline to complete.

0 Answers
Related