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

Update readme.md - different env in ios #281

Merged
merged 2 commits into from
Jun 13, 2020
Merged

Conversation

jslowack
Copy link
Contributor

The use of /tmp/envfile is a bad idea, especially when there is one machine doing multiple builds on the same machine in parallel (eg. build server).

IMHO it is much better to copy the correct .env.staging file to the default .env file. In this way we are not modifying system-wide files like /tmp/envfile.

Do you guys agree?

The use of /tmp/envfile is a bad idea, especially when there is one machine doing multiple builds on the same machine in parallel (eg. build server). 

IMHO it is much better to copy the correct .env.staging file to the default .env file. In this way we are not modifying system-wide files like /tmp/envfile.

Do you guys agree?
@luancurti luancurti merged commit 9740d5f into lugg:master Jun 13, 2020
@@ -139,11 +139,9 @@ Then edit the newly created scheme to make it use a different env file. From the
- Click "Pre-actions", and under the plus sign select "New Run Script Action"
- Where it says "Type a script or drag a script file", type:
```
echo ".env.staging" > /tmp/envfile # replace .env.staging for your file
cp ${PROJECT_DIR}/../.env.staging .env # replace .env.staging for your file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Shouldn't the destination be ${PROJECT_DIR}/../.env then?
  2. there is another reference to "/tmp/envfile" up the text
  3. in terms of implementation /tmp/envfile takes priority, however this is nowhere documented; I would expect either to document it or to remove it from the code entirely

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The /tmp/envfile priority is definitely confusing especially if switching to the new recommendation on a CI server where past builds populated /tmp/envfile.

@maharjanaman
Copy link

@jslowack Following the updated readme, I get cp: /../.env.production: No such file or directory while building binary with fastlane and the binary is not taking specified .env.*. Did I miss anything?

jjd314 added a commit to jjd314/react-native-config that referenced this pull request Jul 24, 2020
There's a comment as part of the review of pull request lugg#281 by @danielwinkler that the build pre-action for iOS should copy the .env.staging (or whatever) file to ${PROJECT_DIR}/../.env, which turns out to be correct.  This change updates the README to reflect that (and also addresses his other comment about the second reference to /tmp/envfile).

@maharjanaman also mentioned on that pull request a problem with the script, and I believe that was from not having a "Provide build settings from" selection, so I added a comment about that, as well.
luancurti pushed a commit that referenced this pull request Aug 4, 2020
There's a comment as part of the review of pull request #281 by @danielwinkler that the build pre-action for iOS should copy the .env.staging (or whatever) file to ${PROJECT_DIR}/../.env, which turns out to be correct.  This change updates the README to reflect that (and also addresses his other comment about the second reference to /tmp/envfile).

@maharjanaman also mentioned on that pull request a problem with the script, and I believe that was from not having a "Provide build settings from" selection, so I added a comment about that, as well.
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

Successfully merging this pull request may close these issues.

5 participants