{"action":"created","issue":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/1303","repository_url":"https://api.github.com/repos/facebookincubator/create-react-app","labels_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/1303/labels{/name}","comments_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/1303/comments","events_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/1303/events","html_url":"https://github.com/facebookincubator/create-react-app/issues/1303","id":196901077,"number":1303,"title":"How to manage deployment stages with env vars","user":{"login":"bebbi","id":2752391,"avatar_url":"https://avatars.githubusercontent.com/u/2752391?v=3","gravatar_id":"","url":"https://api.github.com/users/bebbi","html_url":"https://github.com/bebbi","followers_url":"https://api.github.com/users/bebbi/followers","following_url":"https://api.github.com/users/bebbi/following{/other_user}","gists_url":"https://api.github.com/users/bebbi/gists{/gist_id}","starred_url":"https://api.github.com/users/bebbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bebbi/subscriptions","organizations_url":"https://api.github.com/users/bebbi/orgs","repos_url":"https://api.github.com/users/bebbi/repos","events_url":"https://api.github.com/users/bebbi/events{/privacy}","received_events_url":"https://api.github.com/users/bebbi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-21T10:45:32Z","updated_at":"2016-12-21T12:34:27Z","closed_at":null,"body":"Deploy pipelines (test, prod) based on environment vars are important for some apps.\r\n\r\nAs most static deploy options may not handle the `npm run build` by themselves (allowing to register stage specific env vars at design time), I think some README advice on how to manage stage specific env vars would be helpful to many.\r\n\r\nOr perhaps an enhancement like\r\n`STAGE=MYSTAGE npm run build` which selects the `REACT_APP_MYSTAGE_SOMEVAR` env var?\r\n"},"comment":{"url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/comments/268512663","html_url":"https://github.com/facebookincubator/create-react-app/issues/1303#issuecomment-268512663","issue_url":"https://api.github.com/repos/facebookincubator/create-react-app/issues/1303","id":268512663,"user":{"login":"bebbi","id":2752391,"avatar_url":"https://avatars.githubusercontent.com/u/2752391?v=3","gravatar_id":"","url":"https://api.github.com/users/bebbi","html_url":"https://github.com/bebbi","followers_url":"https://api.github.com/users/bebbi/followers","following_url":"https://api.github.com/users/bebbi/following{/other_user}","gists_url":"https://api.github.com/users/bebbi/gists{/gist_id}","starred_url":"https://api.github.com/users/bebbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bebbi/subscriptions","organizations_url":"https://api.github.com/users/bebbi/orgs","repos_url":"https://api.github.com/users/bebbi/repos","events_url":"https://api.github.com/users/bebbi/events{/privacy}","received_events_url":"https://api.github.com/users/bebbi/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T12:34:27Z","updated_at":"2016-12-21T12:34:27Z","body":"@vernondegoede The `NODE_ENV` actually decides on the type of build (optimized or not, etc.). This doesn't relate to multi-stage deployment so much, as I need different stages, but each with `NODE_ENV === 'production'`.\r\n\r\nOne could probably add everything into the environment and do something like\r\n```\r\nconst publicKey = process.env[`REACT_APP_${process.env.REACT_APP_STAGE}_PUBLIC_KEY`]\r\n```\r\nfor every env variable, but maybe there are more elegant solutions than this?\r\n"}}
{"actor":{"display_login":"bebbi"}}