File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,14 @@ jobs:
119119 docker :
120120 - image : *build-image
121121 working_directory : *workspace
122+ parameters :
123+ config :
124+ description : |
125+ The config file you want to build the app using.
126+ E.g. 'development' would load configurations from 'config/development.json'
127+ type : enum
128+ enum : ["development", "staging", "production"]
129+ default : production
122130 steps : # steps that comprise the `build` job
123131 - attach_workspace :
124132 at : *workspace
@@ -131,7 +139,7 @@ jobs:
131139 name : Build static side
132140 command : |
133141 yarn
134- yarn build
142+ REACT_APP_CONFIG=<< parameters.config >> yarn build
135143
136144 - persist_to_workspace :
137145 root : /home/circleci/project
Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ import InfoPanel from "./components/Info";
77
88// Set config based on the environment variable the build was run under.
99let config = { } ;
10- if ( process . env . NODE_ENV === "production" ) {
10+ if ( process . env . REACT_APP_CONFIG === "production" ) {
1111 config = require ( "./config/production.json" ) ;
12- } else if ( process . env . NODE_ENV === "staging" ) {
12+ } else if ( process . env . REACT_APP_CONFIG === "staging" ) {
1313 config = require ( "./config/staging.json" ) ;
1414} else {
1515 config = require ( "./config/development.json" ) ;
You can’t perform that action at this time.
0 commit comments