-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support system variables? #6
Comments
@Karumi/commanders I'm not sure if this feature would be helpful right now. Multiple environments could be configured using flavors or build types as described in the official documentation. Before thinking about supporting config override by env vars, I'd first ensure we can use flavors and build configs properly. What do you think guys? |
I think it is helpful because we want to have those variables even in iOS and Javascript, the idea is to have the same I don't think we need to do something with environment variables because they are defined in runtime, and we want to add properties in build time. We can connect Android app client flavors to Hagu Build environments and if you are running staging flavors / build type you can have a Doing it in this way, you don't need to duplicate keys for the common library module, which is the main idea. Does it make sense of what I said? |
Using environment variables could be handy for the scenarios @geftimov suggested. |
I think we can close this one, I will create a fork with the following functionality. Thanks for the discussion. |
I reopen the issue because it could be interesting to create a way where you can create BuildConfig from env variables for Continuous Integration / mixing secrets with hardcoded values. My proposal allows From the example on README, something like that
If you want to add this feature @geftimov feel free to create a fork and make PR, if not, I'll add it at some point, thank you!! |
@geftimov I'm working on this issue, finally, the first approximation to resolve this issue, You'll be able to select different configuration profiles for debugging, production, ci, etc. With adding a Gradle property to select the profile you want to use in this way:
In the next iteration, I'll in the CI or Release profiles you'll be able to add env vars to your properties in this way:
I hope this new functionality will help :D |
This is great thanks. Without env varsgradle.properties
code
Without env varsenv vars
gradle.properties
code
|
That is for the second iteration, and not sure if I should do that because having separated profiles, you will see explicitly the env vars used in your application. At the code level, it doesn't matter how I get the env vars, so, let me think about it, anyway, the feature will be done! I'm going to open the PR in a few hours to use different profiles! 👏 |
Great job ! |
I didn't use the template because this issue is more a question.
Do you plan to integrate environment variables?
I mean if you have a key
api_key
in your properties file but in the meantime,you have an environment variable with the same name
api_key
.Should the env var override the variable in the properties file?
That will allow you to pass variables while building your app in a CI setup.
Even better you can configure your CI to build multiple environments with different app names, backend URLs, etc...
The text was updated successfully, but these errors were encountered: