Skip to content

Commit

Permalink
Added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Razz4780 committed Nov 20, 2024
1 parent 8faab73 commit fef5ade
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
5 changes: 3 additions & 2 deletions mirrord-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,8 @@
"type": "object",
"properties": {
"env_file": {
"description": "TODO doc",
"title": "feature.env_file {#feature-env-file}",
"description": "Allows for passing environment variables from an env file.\n\nThese variables will override environment fetched from the remote target.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -743,7 +744,7 @@
},
"override": {
"title": "feature.env.override {#feature-env-override}",
"description": "Allows setting or overriding environment variables (locally) with a custom value.\n\nFor example, if the remote pod has an environment variable `REGION=1`, but this is an undesirable value, it's possible to use `override` to set `REGION=2` (locally) instead.",
"description": "Allows setting or overriding environment variables (locally) with a custom value.\n\nFor example, if the remote pod has an environment variable `REGION=1`, but this is an undesirable value, it's possible to use `override` to set `REGION=2` (locally) instead.\n\nEnvironment specified here will also override variables passed via the env file.",
"type": [
"object",
"null"
Expand Down
2 changes: 1 addition & 1 deletion mirrord/cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ pub(super) struct ExecParams {
#[arg(long)]
pub context: Option<String>,

/// TODO doc
/// Path to env file that should be used for the execution.
#[arg(long, value_hint = ValueHint::FilePath)]
pub env_file: Option<PathBuf>,
}
Expand Down
8 changes: 7 additions & 1 deletion mirrord/config/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ See the environment variables [reference](https://mirrord.dev/docs/reference/env
}
```

TODO doc
### feature.env_file {#feature-env-file}

Allows for passing environment variables from an env file.

These variables will override environment fetched from the remote target.

### feature.env.exclude {#feature-env-exclude}

Expand Down Expand Up @@ -689,6 +693,8 @@ Allows setting or overriding environment variables (locally) with a custom value
For example, if the remote pod has an environment variable `REGION=1`, but this is an
undesirable value, it's possible to use `override` to set `REGION=2` (locally) instead.

Environment specified here will also override variables passed via the env file.

### feature.env.unset {#feature-env-unset}

Allows unsetting environment variables in the executed process.
Expand Down
8 changes: 7 additions & 1 deletion mirrord/config/src/feature/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ pub struct EnvConfig {
///
/// For example, if the remote pod has an environment variable `REGION=1`, but this is an
/// undesirable value, it's possible to use `override` to set `REGION=2` (locally) instead.
///
/// Environment specified here will also override variables passed via the env file.
pub r#override: Option<HashMap<String, String>>, // `r#`: `override` is a Rust keyword.

/// ### feature.env.load_from_process {#feature-env-load_from_process}
Expand All @@ -96,7 +98,11 @@ pub struct EnvConfig {
/// and `Aws_Profile` and other variations.
pub unset: Option<VecOrSingle<String>>,

/// TODO doc
/// ### feature.env_file {#feature-env-file}
///
/// Allows for passing environment variables from an env file.
///
/// These variables will override environment fetched from the remote target.
#[config(env = MIRRORD_OVERRIDE_ENV_FILE_ENV)]
pub env_file: Option<PathBuf>,
}
Expand Down

0 comments on commit fef5ade

Please sign in to comment.