Skip to content

Commit

Permalink
Use Manifold CLI to get environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmersnoeck committed Feb 9, 2018
1 parent 22da367 commit 9bcafec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_STRIPE_KEY=pk-supersecret
REACT_APP_SEGMENT_KEY=segment-super-secret
REACT_APP_STRIPE_KEY=${STRIPE_KEY}
REACT_APP_SEGMENT_KEY=${SEGMENT_KEY}
2 changes: 2 additions & 0 deletions .manifold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
team: siphoc
project: demo-app
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.env.local:
cat .env | grep = | sort | sed -e 's|\([a-zA-Z_]*\)=\(.*\)|\1=NGINX_REPLACE_\1|' > .env.local
manifold export | grep = | sort | sed -e 's|\([a-zA-Z_]*\)=\(.*\)|REACT_APP_\1=NGINX_REPLACE_\1|' > .env.local

build/index.html: .env.local
yarn build

NGINX_SUB_FILTER?=$(shell cat .env | grep '=' | sort | sed -e 's/\(.*\)=\(.*\)/sub_filter\ \"NGINX_REPLACE_\1\" \"$$\{\1\}\";/')
NGINX_SUB_FILTER?=$(shell manifold export | grep '=' | sort | sed -e 's/\(.*\)=\(.*\)/sub_filter\ \"NGINX_REPLACE_\1\" \"$$\{\1\}\";/')

nginx.conf:
cat nginx.conf.sample | sed -e 's|LOCATION_SUB_FILTER|\${NGINX_SUB_FILTER}|' | sed 's|}";\ |}";\n\t\t|g' > nginx.conf
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ services:
- 3001:3001
environment:
- PORT=${PORT:-3001}
- REACT_APP_STRIPE_KEY=pk-docker-compose-supersecret
- REACT_APP_SEGMENT_KEY=segment-docker-compose-secret
- STRIPE_KEY=pk-docker-compose-supersecret
- SEGMENT_KEY=segment-docker-compose-secret

0 comments on commit 9bcafec

Please sign in to comment.