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

Consider automatic directory set-up using proj.yml when using devcontainers #99

Closed
MiguelRodo opened this issue Aug 26, 2022 · 5 comments
Assignees
Labels
activate Concerns projr_activate fast Quick to do v1.0.0 Part of first major release

Comments

@MiguelRodo
Copy link
Collaborator

MiguelRodo commented Aug 26, 2022

Issues

  • If based on working directory, can't customise as the working directory is always the same (well, by default)

  • Can't use some file (e.g. "user-mrodo_devcontainer") as these have to be recreated in the devcontainer every time

  • This is really a bit of a mess-up, as the environment is supposed to be "standardised" and here it isn't

Possible solutions

@MiguelRodo MiguelRodo self-assigned this Aug 26, 2022
@MiguelRodo
Copy link
Collaborator Author

Best solution thus far

Export the container environment variable localWorkspaceFolder to the container using these lines in .devcontainer.json:

"remoteEnv": {
  "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
}

Then, when projr sets up the directory, it will use this variable if it exists, otherwise it will use its actual working directory.

@MiguelRodo
Copy link
Collaborator Author

I think we're going to call this PROJR_SYSTEM_ID. Better than PROJR_USER as this isn't about a specific user necessarily, it's actually about the system. Also better than PROJR_WORKING_DIRECTORY as this need not be a directory.

@MiguelRodo
Copy link
Collaborator Author

It is still useful as docker containers in VSC mount the code directory into a user-independent location, and so would be the same across many users.

@MiguelRodo MiguelRodo added the activate Concerns projr_activate label Oct 10, 2022
@MiguelRodo
Copy link
Collaborator Author

We've already made settings depend on the environment variable, so this is actually done. What we need to do is quick and just rename it to PROJR_SYSTEM_ID.

@MiguelRodo MiguelRodo added v1.0.0 Part of first major release fast Quick to do labels Oct 10, 2022
@MiguelRodo
Copy link
Collaborator Author

Done. We have extensive profile abilities, so this is easily handled by setting the environmanent variable PROJR_PROFILE in dockerfile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activate Concerns projr_activate fast Quick to do v1.0.0 Part of first major release
Projects
None yet
Development

No branches or pull requests

1 participant