8000 feat: allow changing default workspaces folder by mafredri · Pull Request #406 · coder/envbuilder · GitHub
[go: up one dir, main page]

Skip to content

feat: allow changing default workspaces folder #406

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

Merged
merged 5 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sort
  • Loading branch information
mafredri committed Nov 5, 2024
commit 57bf6648af99ea88326c8b1a0b7b27d6f77f0f1f
2 changes: 1 addition & 1 deletion docs/env-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
| `--git-ssh-private-key-path` | `ENVBUILDER_GIT_SSH_PRIVATE_KEY_PATH` | | Path to an SSH private key to be used for Git authentication. If this is set, then GIT_SSH_PRIVATE_KEY_BASE64 cannot be set. |
| `--git-ssh-private-key-base64` | `ENVBUILDER_GIT_SSH_PRIVATE_KEY_BASE64` | | Base64 encoded SSH private key to be used for Git authentication. If this is set, then GIT_SSH_PRIVATE_KEY_PATH cannot be set. |
| `--git-http-proxy-url` | `ENVBUILDER_GIT_HTTP_PROXY_URL` | | The URL for the HTTP proxy. This is optional. |
| `--workspace-folder` | `ENVBUILDER_WORKSPACE_FOLDER` | | The path to the workspace folder that will be built. This is optional. Defaults to `[workspace base dir]/[name]` where name is the name of the repository or `empty`. |
| `--workspace-base-dir` | `ENVBUILDER_WORKSPACE_BASE_DIR` | `/workspaces` | The path under which workspaces will be placed when workspace folder option is not given. |
| `--workspace-folder` | `ENVBUILDER_WORKSPACE_FOLDER` | | The path to the workspace folder that will be built. This is optional. Defaults to `[workspace base dir]/[name]` where name is the name of the repository or `empty`. |
| `--ssl-cert-base64` | `ENVBUILDER_SSL_CERT_BASE64` | | The content of an SSL cert file. This is useful for self-signed certificates. |
| `--export-env-file` | `ENVBUILDER_EXPORT_ENV_FILE` | | Optional file path to a .env file where envbuilder will dump environment variables from devcontainer.json and the built container image. |
| `--post-start-script-path` | `ENVBUILDER_POST_START_SCRIPT_PATH` | | The path to a script that will be created by envbuilder based on the postStartCommand in devcontainer.json, if any is specified (otherwise the script is not created). If this is set, the specified InitCommand should check for the presence of this script and execute it after successful startup. |
Expand Down
22 changes: 11 additions & 11 deletions options/options.go
873D
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ type Options struct {
GitSSHPrivateKeyBase64 string
// GitHTTPProxyURL is the URL for the HTTP proxy. This is optional.
GitHTTPProxyURL string
// WorkspaceBaseDir is the path under which workspaces will be placed when
// workspace folder option is not given.
WorkspaceBaseDir string
// WorkspaceFolder is the path to the workspace folder that will be built.
// This is optional. Defaults to `[workspace base dir]/[name]` where name is
// the name of the repository or "empty".
WorkspaceFolder string
// WorkspaceBaseDir is the path under which workspaces will be placed when
// workspace folder option is not given.
WorkspaceBaseDir string
// SSLCertBase64 is the content of an SSL cert file. This is useful for
// self-signed certificates.
SSLCertBase64 string
Expand Down Expand Up @@ -395,14 +395,6 @@ func (o *Options) CLI() serpent.OptionSet {
Value: serpent.StringOf(&o.GitHTTPProxyURL),
Description: "The URL for the HTTP proxy. This is optional.",
},
{
Flag: "workspace-folder",
Env: WithEnvPrefix("WORKSPACE_FOLDER"),
Value: serpent.StringOf(&o.WorkspaceFolder),
Description: "The path to the workspace folder that will be built. " +
"This is optional. Defaults to `[workspace base dir]/[name]` where " +
"name is the name of the repository or `empty`.",
},
{
Flag: "workspace-base-dir",
Env: WithEnvPrefix("WORKSPACE_BASE_DIR"),
Expand All @@ -411,6 +403,14 @@ func (o *Options) CLI() serpent.OptionSet {
Description: "The path under which workspaces will be placed when " +
"workspace folder option is not given.",
},
{
Flag: "workspace-folder",
Env: WithEnvPrefix("WORKSPACE_FOLDER"),
Value: serpent.StringOf(&o.WorkspaceFolder),
Description: "The path to the workspace folder that will be built. " +
"This is optional. Defaults to `[workspace base dir]/[name]` where " +
"name is the name of the repository or `empty`.",
},
{
Flag: "ssl-cert-base64",
Env: WithEnvPrefix("SSL_CERT_BASE64"),
Expand Down
Loading
0