From 214eab3be77a90e426605c4f92ffc7472f09be0c Mon Sep 17 00:00:00 2001 From: Martin Vogel <martin.vogel@sinc.de> Date: Thu, 15 Sep 2022 15:18:41 +0200 Subject: [PATCH] refactor(config): rename environment config var to FIT_CONNECT_CONFIG --- README.md | 2 +- client/README.md | 6 +++--- .../dev/fitko/fitconnect/client/factory/ClientFactory.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 458a33d45..d385147c5 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ _The following steps show how to get the SDK running_ Configuration properties e.g. for REST-API urls and proxy settings can be found in the YAML config ``config.yml`` within the root folder of the project. -In order to run the SDK client a configuration needs to be provided as file in the same path as the jar (e.g. when the commandline client is used) or via reference using the environment variable ``CONFIG_LOCATION`` (e.g. when the SDK is used programmatically). +In order to run the SDK client a configuration needs to be provided as file in the same path as the jar (e.g. when the commandline client is used) or via reference using the environment variable ``FIT_CONNECT_CONFIG`` (e.g. when the SDK is used programmatically). <p align="right">(<a href="#top">back to top</a>)</p> diff --git a/client/README.md b/client/README.md index 486ba3189..c8a2130f9 100644 --- a/client/README.md +++ b/client/README.md @@ -6,9 +6,9 @@ The sdk comes with a commandline client to be able to use the sdk without any co #### Setup & Build 1. Build project root wih ``./mvnw clean package`` 2. Go to client/target and find a runnable jar ``client-VERSION.jar`` -3. set environment variable ``CONFIG_LOCATION`` or drop a configured [config.yml](../config.yml) file next to the runnable jar - 1. Linux/MacOS: ``export CONFIG_LOCATION=path/to/config.yml`` - 2. Windows: ``set CONFIG_LOCATION=C:\Path\To\config.yml`` +3. set environment variable ``FIT_CONNECT_CONFIG`` or drop a configured [config.yml](../config.yml) file next to the runnable jar + 1. Linux/MacOS: ``export FIT_CONNECT_CONFIG=path/to/config.yml`` + 2. Windows: ``set FIT_CONNECT_CONFIG=C:\Path\To\config.yml`` 4. run client with ``java -jar client-VERSION.jar [COMMAND] [OPTIONS]`` #### SEND Example diff --git a/client/src/main/java/dev/fitko/fitconnect/client/factory/ClientFactory.java b/client/src/main/java/dev/fitko/fitconnect/client/factory/ClientFactory.java index 40e8d0439..6a6aeb31a 100644 --- a/client/src/main/java/dev/fitko/fitconnect/client/factory/ClientFactory.java +++ b/client/src/main/java/dev/fitko/fitconnect/client/factory/ClientFactory.java @@ -45,7 +45,7 @@ public final class ClientFactory { private static final Logger LOGGER = LoggerFactory.getLogger(ClientFactory.class); private static final String CONFIG_DEFAULT_LOCATION = "config.yml"; - private static final String CUSTOM_CONFIG_KEY = "CONFIG_LOCATION"; + private static final String CUSTOM_CONFIG_KEY = "FIT_CONNECT_CONFIG"; private static final String SENDER_BANNER = getSplashScreenResource("/sender-banner.txt"); private static final String SUBSCRIBER_BANNER = getSplashScreenResource("/subscriber-banner.txt"); @@ -215,7 +215,7 @@ public final class ClientFactory { LOGGER.info("Using sdk environment config {} with {}", applicationConfig.getCurrentEnvironment(), applicationConfig); return applicationConfig; } catch (final IOException e) { - throw new IllegalStateException("Config could not be loaded, please provide a 'config.yml' in the root path or in the ENV-var 'CONFIG_LOCATION'", e); + throw new IllegalStateException("Config could not be loaded, please provide a 'config.yml' in the root path or in the ENV-var 'FIT_CONNECT_CONFIG'", e); } } -- GitLab