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

cmd: fix config file from env variable issue in subcommands #4344

Merged
merged 2 commits into from
Dec 6, 2019

Conversation

fristonio
Copy link
Contributor

@fristonio fristonio commented Dec 3, 2019

So with a config.json looking like this we can override the config
variables.

{
     "my": "localhost:5180",
     "port_offset": 100,
     "idx": 1
}

Override the configuration using the above config file using the command

DGRAPH_ALPHA_CONFIG=config.json dgraph alpha

DGRAPH_ZERO_CONFIG=config.json dgraph zero

Signed-off-by: Deepesh Pathak [email protected]


This change is Reviewable

* Fixes dgraph-io#4311
* Each subcommand can specify the config file to use using the
environment varaible which is of the form `<ENV_PREFIX>_CONFIG`, for
example `DGRAPH_ZERO_CONFIG`.

So with a `config.json` looking like this we can override the config
variables.

```json
{
     "my": "localhost:5180",
     "port_offset": 100,
     "idx": 1
}
```

Override the configuration using the above config file using the command

```bash
DGRAPH_ALPHA_CONFIG=config.json dgraph alpha

DGRAPH_ZERO_CONFIG=config.json dgraph zero
```

Signed-off-by: Deepesh Pathak <[email protected]>
@fristonio fristonio requested review from manishrjain and a team as code owners December 3, 2019 11:42
Copy link
Contributor

@prashant-shahi prashant-shahi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

Copy link
Contributor

@prashant-shahi prashant-shahi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @manishrjain)

@prashant-shahi prashant-shahi merged commit ea791d0 into dgraph-io:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Setting config file in Alpha and Zero not working using environment variable
2 participants