-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YOMA-228 - chore: create env variable flow (#10)
* chore: adding env creation and adding yoma api url to env and implementing in app * chore: updating help.js with env:dev and env:test descriptions * chore: removing testing on push now that circleci is setup
- Loading branch information
1 parent
7aec8f6
commit 639e775
Showing
11 changed files
with
41 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,6 @@ buck-out/ | |
|
||
|
||
.xgitconfig | ||
src/env.json | ||
|
||
android/java_pid843420.hprof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"YOMA_API_BASE_PATH": "https://staging.api.yoma.africa/api/v1/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const fs = require('fs') | ||
const R = require('ramda') | ||
|
||
// get environment to generate from supplied argument: | ||
const env = process.argv[2] | ||
if (!env) { | ||
console.error('\x1b[31m', 'No environment supplied!') | ||
console.log('\x1b[33m', 'Please set an environment variable and try again') | ||
process.exit(1) | ||
} | ||
// get the correct env file | ||
const commonSettings = require('./common.json') | ||
const envSettings = require(`./${env}.json`) | ||
|
||
// generate settings object | ||
const settings = R.mergeDeepRight(commonSettings, envSettings) | ||
|
||
// create the env.json file in src from both files | ||
fs.writeFileSync('src/env.json', JSON.stringify(settings, undefined, 2)) | ||
console.log('\x1b[32m', 'Success! env.json has been generated.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"YOMA_API_BASE_PATH": "https://staging.api.yoma.africa/api/v1/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters