fromEnvironment doesn't pick up the Environment variables #1899
-
If you are looking for help, please confirm the following...
Which mobile framework are you using?Flutter (Dart) Steps to reproduce
Expected resultsmy secret api key specified in Environment variables tab in Workflow Editor Actual results0000 Build id (optional)No response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I have resolved the problem with the following set-up. environment variables: pre-build scripts: Create directory if it doesn't existmkdir -p $CM_BUILD_DIR/config Write out the environment variable as a json fileecho $APP_CONFIG > $CM_BUILD_DIR/config/prod.json build command flags: |
Beta Was this translation helpful? Give feedback.
-
How to set APP_CONFIG={"CLOUDFLARE_API_KEY": xxxxxx} in Workflow Editor ? Is APP_CONFIG a variable name on the variables tab? And where do you enter "build command flags: |
Beta Was this translation helpful? Give feedback.
I have resolved the problem with the following set-up.
environment variables:
APP_CONFIG={"CLOUDFLARE_API_KEY": xxxxx}
pre-build scripts:
Create directory if it doesn't exist
mkdir -p $CM_BUILD_DIR/config
Write out the environment variable as a json file
echo $APP_CONFIG > $CM_BUILD_DIR/config/prod.json
build command flags:
--dart-define-from-file config/prod.json