Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

[PAN-2832] Support setting config options via environment variables #1597

Merged
merged 2 commits into from
Jun 24, 2019

Conversation

ajsutton
Copy link
Contributor

PR description

Supports setting config options via environment variables. Each CLI config option has an equivalent environment variable which is all upper-case, - becomes _ and a PANTHEON_ prefix is added. So --miner-coinbase can be set via PANTHEON_MINER_COINBASE.

When the same option is set via multiple means, Pantheon will use the priority order: CLI arg, env var, config file.

environment.put("PANTHEON_H", "abc");
assertThat(provider.defaultValue(OptionSpec.builder("-h").build())).isNull();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@joshuafernandes joshuafernandes left a comment

Choose a reason for hiding this comment

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

Nice!

@ajsutton ajsutton merged commit a1922be into PegaSysEng:master Jun 24, 2019
@ajsutton ajsutton deleted the env-config branch June 24, 2019 02:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants