Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In VPN mode instead of exporting environment variables write them into a .env file #608

Closed
ddehghan opened this issue Apr 23, 2018 · 2 comments
Closed
Assignees
Labels

Comments

@ddehghan
Copy link

@ddehghan ddehghan commented Apr 23, 2018

This way they can be loaded by the IDE for debugging.

Currently the IDE used for debugger (like PyCharm) is running in is own context and is not aware of the environment variables set by telepresence in the shell. But if these were written into a file they can easily be loaded by python into the correct environment.

my workaround is to create a shell script to get the env and write it into a file.

sed -i 's|TELEPRESENCE_ROOT.*|TELEPRESENCE_ROOT='"$TELEPRESENCE_ROOT"'|' ./app/.env

@ark3 ark3 added the enhancement label Apr 23, 2018
@ark3
Copy link
Contributor

@ark3 ark3 commented Apr 25, 2018

https://plugins.jetbrains.com/plugin/7861-env-file
Note to self: This plugin supports JSON and YAML too.

@ark3
Copy link
Contributor

@ark3 ark3 commented Apr 25, 2018

If we give Telepresence the ability to output an env file, eventually we'll need to decide which variant we generate. Here are a few options:

  1. Docker compose. No special treatment for quotation marks. Might be same code for docker run --env-file, which does not support multi-line values.
  2. Node dotenv package. Fancy treatment of quotation marks.
  3. VS Code Python plugin. Explicitly has no support for multi-line values.

Generating JSON avoids these concerns, but might not be as broadly useful.

@ark3 ark3 self-assigned this Apr 26, 2018
@ark3 ark3 closed this in e898d90 May 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.