Skip to main content

Environment variables in a monorepo project

Comments

1 comment

  • Chad Carlson

    Hi there!

    I believe if 1) every application’s source.root is set to the root directory and 2) you commit a .environment file at root, every application will have access to that REDIS_URL variable.

    Your method of using a check for PLATFORM_APPLICATION_NAME in .environment should work though for this purpose. In the end, it’s probably the simplest way.

    Placing it in .environment is the easiest way to ensure that the variable is available at deploy, post_deploy, command.start, and during SSH sessions. You could define it explicitly in applications.yaml for the app that actually needs access to it, but you would need to repeat the export statement at each of the stages I’ve listed above, and then it still wouldn’t be accessible by default when you SSH into that app container.

    0

Please sign in to leave a comment.