I tried to find my way around using variables in prisma.yml but they look outdated to me.
I can get them up to speed if someone can point me to the correct syntax of the three type of variables and any changes that are planned for them.
Thanks
Hey @divyenduz, thanks a lot for the feedback! Could you be a bit more specific what exactly you consider outdated? If anything doesn't work as described in the docs it's probably a bug in the CLI.
Hi @nikolasburk, here are a few details
divyendusingh [deep-dive]$ prisma --version
prisma/1.2.4 (darwin-x64) node-v8.4.0
Trying to set a default value in prisma.yml like this cluster: ${env:PRISMA_CLUSTER, local} yields the following warning Invalid variable reference syntax for variable local. While writing this though I realized that cluster: ${env:PRISMA_CLUSTER, "local"} works fine - wrapping local in quotes. I think this can be documented.
Trying to use CLI option like stage: ${opt:PRISMA_STAGE} then I tried to call the option via CLI like
prisma deploy --PRISMA_STAGE prod and prisma deploy -PRISMA_STAGE prod and the CLI yields the following:-
divyendusingh [deep-dive]$ prisma deploy -PRISMA_STAGE prod
▸ [WARNING] in
▸ /Users/divyendusingh/Documents/projects/graphcool/prisma-examples/deep-dive/database/prisma.yml: A
▸ valid option to satisfy the declaration 'opt:PRISMA_STAGE' could not be found.
▸ Invalid prisma.yml file
▸ prisma.yml should have required property 'stage'. missingProperty: stage
Usage of options can be documented.
self: docs access it as self: at some places which works and is correct but as self. (like url: ${self.custom.severlessEndpoint}/createCRMEntry) in some places which is a typo. Thanks!
Great, thanks a lot for the detailled info! Will tackle it soon 👍
Another question I have about this is that can it only read environment from .env or a file supplied behind the --dotenv argument?
I was trying to use environment variable set via pm2 ecosystem file (and via plain old export) but prisma deploy failed to pick that up.
All right, so the docs have been updated. Regarding your issues:
self.custom to self:customThanks again for opening the issue!
Be sure you are always reading the latest version of the docs, not just what google serves.
After testing various configurations, I found the hard way that the default env values were removed from prisma. The best option is to use two .env files. This faulty configuration is the root cause of the Only absolute URLs are supported error.
Hopefully this helps someone.