The purpose of the project is to be able to have multi-environment (dev, staging, preprod, production...) in a React Native project. It means:
-
Being able to have multiple Build configurations on iOS in order to have each configuration having it's own bundle id, team, provisioning profile, app name, etc.
-
Being able to have multiple build types on Android in order to have each build type having it's own package id, keystores, etc.
-
Being able to have variables accessible in the React Native code that are different for each environment (BACKEND_URL, API_KEY, if ENV == STAGING..., etc.)
-
Work in local as well as in Microsoft App Center
-
Do not depend on unmaintained React Native librairies
-
Do not dependend on fastlane (because fastlane + MS AppCenter is too much)
Each git branch is tied to an environment. For example:
develop = develop (if needed) master = staging production = production
- Add a property into the devops..json file.
- Access the property in the React Native code:
import devopsJson from './devops.json';
{devopsJson["BACKEND_URL"]}
- GO to XCode and edit build configurations
- Edit the appcenter-pre-build.sh script
- GO to Android Studio and edit app/build.gradle file
- Edit the appcenter-pre-build.sh script