How can I separate `dev` from `prod` environment v...
# orm-help
s
How can I separate
dev
from
prod
environment variables for the graphcool.yml and the authentication scripts of a graphcool-framework project? I think this answer is outdated: https://www.prisma.io/forum/t/1-0-different-environments-different-graphcool-yml-files/2105/2
maybe some indication about how to write
.graphcoolrc
p
I'm working on that today
I've put all variables for all STAGES/ENVS/TARGETS in
graphcool.yml
- I work alone on a project so I don't care about sharing secrets
s
i just solved this in a different way: i used
.graphcoolrc
with this code:
Copy code
targets:
  default: prod
  prod: shared-eu-west-1/xxxxx......
  dev: shared-eu-west-1/xxxxxx.....
p
and how did you defined variables for each target?
s
and i put in side the folder
.db_prod.env
AND
.db_dev.env
yes
and i redefined the script from my package.json
like this:
Copy code
"deploy-prod": "node -r dotenv/config $(which graphcool) deploy --target prod dotenv_config_path=.db_prod.env",
p
ok, I see
s
this one deploys on prod using the correct target from .graphcoolrc and correct env variables thanks to dotenv library
this should be enough to deploy the same mod over multiple db projects
BUT now i don't remember how to generate a permanent auth token (PAT)
because it is needed if you want to use the db from a server for example
p
cool. I think I will stay with my variables in
graphcool.yml
- one dependency less
s
do you happen to know remember how to get the PAT?
p
on web console or via cli i think
just check it
gc --help
s
i have seen it... nothing useful
p
gc root-token --help
so you must go to web console and create under project settings