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

Building a release with a specific environement file #200

Closed
ous24 opened this issue Jul 16, 2021 · 10 comments
Closed

Building a release with a specific environement file #200

ous24 opened this issue Jul 16, 2021 · 10 comments
Assignees

Comments

@ous24
Copy link

ous24 commented Jul 16, 2021

i can't figure a way to build a release with my .env.staging , the release always use the .env.production file

@github-actions
Copy link

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/200

@goatandsheep
Copy link
Owner

You will need to configure your signing config for each of your environments
https://reactnative.dev/docs/signed-apk-android#adding-signing-config-to-your-apps-gradle-config

@simonkarman
Copy link

simonkarman commented Aug 31, 2021

@goatandsheep Where in the signingconfig can you specify the name of the environment it should use?

@stale
Copy link

stale bot commented Oct 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Oct 30, 2021
@stale stale bot closed this as completed Nov 7, 2021
@v4irajvimu
Copy link

v4irajvimu commented Sep 18, 2022

i can't figure a way to build a release with my .env.staging , the release always use the .env.production file

did you find a way? @ous24

@brianwachira
Copy link

i can't figure a way to build a release with my .env.staging , the release always use the .env.production file

did you find a way? @ous24

did you find a way @v4irajvimu ?

@goatandsheep
Copy link
Owner

goatandsheep commented Oct 26, 2022

I will review this ticket to add signing config details to Lib docs

@goatandsheep goatandsheep reopened this Oct 26, 2022
@stale stale bot removed the wontfix This will not be worked on label Oct 26, 2022
@github-actions
Copy link

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/200

@goatandsheep
Copy link
Owner

I will review this ticket but likely I'll recommend setting NODE_ENV if you're not just using development and production i.e. debug and release respectively and using the dev flag. Otherwise APP_ENV for everything else.

@rodgomesc
Copy link

rodgomesc commented Oct 31, 2022

@ous24 i'm modified the "Start Package" script in "Build Phases" and it's working for me, just added

# react-native-dot-env
if [ "$CONFIGURATION" = "Staging" ]; then
  export APP_ENV=stag
elif [ "$CONFIGURATION" = "Release" ]; then
  export APP_ENV=prod
elif [ "$CONFIGURATION" = "Debug" ]; then
  export APP_ENV=dev
fi

echo "export RCT_METRO_PORT=${RCT_METRO_PORT} APP_ENV=${APP_ENV}" > `node --print "require('path').dirname(require.resolve('react-native/package.json')) + '/scripts/.packager.env'"`

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

No branches or pull requests

6 participants