Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developers should be able to easily build and run the app for the different supported envs #5294

Closed
jeanregisser opened this issue Oct 9, 2020 · 0 comments · Fixed by #5191
Assignees

Comments

@jeanregisser
Copy link
Contributor

Expected Behavior

Developers should be able to easily build and run the app for the different supported envs.

Current Behavior

Right now the command for building and running the app, yarn dev:ios or yarn dev:android, allows specifying a different network with the -n $NETWORK flag but it's still using packages/mobile/.env and updates the corresponding google services plist/json to set the realtime db url to use.
This still uses the deprecated celo-org-mobile project, so some functionalities like push notifications and payment requests won't work as expected.
celo-mobile-mainnet and celo-mobile-alfajores projects should be used instead depending on what network the app is running.

Also, it's not easy to run the other envs we have, for instance, the prod config from packages/mobile/.env.mainnet, the developer has to manually update things for this to work.

Similarly, it's not easy to run the app in release mode where the JS bundle and assets are directly included in the app.

@jeanregisser jeanregisser self-assigned this Oct 9, 2020
@mergify mergify bot closed this as completed in #5191 Oct 9, 2020
mergify bot pushed a commit that referenced this issue Oct 9, 2020
### Description

This PR makes it easier to build the app in the different envs we have.
- We now have the following env files, which are mapped to Xcode schemes/Android flavors:
  - `.env.alfajores`
  - `.env.alfajoresdev`
  - `.env.mainnet`
  - `.env.mainnetdev`
  - `.env.test`
- Supports both `debug`/`release` for all envs (for release builds, the js bundle and assets are included in the app package)
- Supports "dev" variants for day-to-day use by developers, can be installed alongside the store apps
- Usage: `yarn dev:ios -e %envName%` or `yarn dev:android -e %envName%`, (`%envName%` can be `alfajores`, `alfajoresdev`, `mainnet`, `mainnetdev` or `test`), add the `-r` flag to produce a release build which doesn't need the packager running
- Other `run_app.sh` script improvements:
  - can build iOS too from the command line (no need to have Xcode running 🎉) and now launches the packager in a different terminal window respecting the user choice of terminal
  - doesn't need to dynamically update the google services plist anymore. This should prevent using the wrong firebase db
  - App can still be launched through Xcode: <img width="382" alt="Screenshot 2020-09-25 at 10 57 28" src="https://user-images.githubusercontent.com/57791/94270913-2233d200-ff41-11ea-98d3-bcc875b7a98e.png">
  - App can also be run from Android Studio if needed: <img width="50%" alt="Screenshot 2020-09-25 at 15 22 02" src="https://user-images.githubusercontent.com/57791/94272139-f1549c80-ff42-11ea-989c-36ff1cac71a8.png">
- Removed unused `pilot` and `integration` networks
- Removed google service configs referencing the deprecated `celo-org-mobile` Firebase project.

Finally it is relatively simple to add new envs if needed.

### Other changes

- Upgraded `react-native-config`

### Tested

Successfully ran:
- `yarn dev:ios`
- `yarn dev:ios -e aflajoresdev`
- `yarn dev:ios -e aflajores`
- `yarn dev:ios -e mainnetdev`
- `yarn dev:ios -e mainnet`
- `yarn dev:ios -r`
- `yarn dev:android`
- `yarn dev:android -e aflajoresdev`
- `yarn dev:android -e aflajores`
- `yarn dev:android -e mainnetdev`
- `yarn dev:android -e mainnet`
- `yarn dev:android -r`
- `yarn test:e2e:ios`
- `yarn test:e2e:ios -r`
- `yarn test:e2e:android` (release mode (`-r`) option doesn't work yet as it fails at runtime due to proguard not keeping some Kotlin classes used by detox).
- `bundle exec fastlane ios mainnet` (though manually disabling upload)
- `bundle exec fastlane android mainnet` (though manually disabling upload)

### Related issues

- Part of #4841
- Fixes #5294

### Backwards compatibility

Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant