env4config

Environment variables resolution for Typesafe Config

Лицензия

Лицензия

Категории

Категории

config Библиотеки уровня приложения Configuration
Группа

Группа

com.codacy
Идентификатор

Идентификатор

env4config
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

env4config
Environment variables resolution for Typesafe Config
Ссылка на сайт

Ссылка на сайт

https://www.codacy.com
Организация-разработчик

Организация-разработчик

Codacy
Система контроля версий

Система контроля версий

https://github.com/codacy/env4config

Скачать env4config

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.codacy/env4config/ -->
<dependency>
    <groupId>com.codacy</groupId>
    <artifactId>env4config</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.codacy/env4config/
implementation 'com.codacy:env4config:1.0.1'
// https://jarcasting.com/artifacts/com.codacy/env4config/
implementation ("com.codacy:env4config:1.0.1")
'com.codacy:env4config:jar:1.0.1'
<dependency org="com.codacy" name="env4config" rev="1.0.1">
  <artifact name="env4config" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.codacy', module='env4config', version='1.0.1')
)
libraryDependencies += "com.codacy" % "env4config" % "1.0.1"
[com.codacy/env4config "1.0.1"]

Зависимости

provided (1)

Идентификатор библиотеки Тип Версия
com.typesafe : config jar 1.3.3

test (4)

Идентификатор библиотеки Тип Версия
org.scala-lang : scala-library jar 2.12.8
org.jacoco : org.jacoco.agent jar 0.7.9
junit : junit jar 4.11
com.novocode : junit-interface jar 0.11

Модули Проекта

Данный проект не имеет модулей.

ENV4CONFIG

Codacy Badge CircleCI Maven Central

This is an alternative config.strategy for Typesafe Config to enable Environment Variable substitution on every configuration key without the need to explicitly bind the substitution in the configuration file.

Please note that this library is published as a road unblocker until this PR find it's way upstream.

Conventions

Each environment variable is transformed as follows:

  • remove the trailing prefix config.env_var_prefix ( Default: CONFIG_FORCE_)
  • trasform all the _ characters into .
  • trasform all the __ characters into -
  • trasform all the ___ characters into _

Usage

Import this library along with Typesafe Config:

libraryDependencies ++= Seq(
  "com.typesafe" % "config" % <typesafe-config-version>,
  "com.codacy" % "env4config" % <version>
)

Then specify the proper config.strategy as a Java property:

java -Dconfig.strategy=com.codacy.config.EnvFirstConfigLoadingStrategy <....>

Rationale

According to the Twelve-factor App the configuration should be passed to the applications via environment variables.

The "de-facto" standard for configuration in Scala application is Typesafe Config and env variables are a supported fallback; still it is not possible to override virtually any configuration of our application if not properly encoded the binding accordingly.

Although Typesafe Config offers an hook as a config.strategy to tune the initial loading order of configurations, leveraging it is possible to load Environment variables first.

This makes it easy to bridge the gap and by having a standard way to convert environment variables into Java system properties make it possible to fully comply with Twelve-factor App.

Compile

You need to have the crystal compiler available in your classpath to succesfully build this utility, otherwise you can compile it statically using a docker image using make buildStatic.

What is Codacy

Codacy is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews.

Among Codacy’s features

  • Identify new Static Analysis issues
  • Commit and Pull Request Analysis with GitHub, BitBucket/Stash, GitLab (and also direct git repositories)
  • Auto-comments on Commits and Pull Requests
  • Integrations with Slack, HipChat, Jira, YouTrack
  • Track issues in Code Style, Security, Error Proneness, Performance, Unused Code and other categories

Codacy also helps keep track of Code Coverage, Code Duplication, and Code Complexity.

Codacy supports PHP, Python, Ruby, Java, JavaScript, and Scala, among others.

Free for Open Source

Codacy is free for Open Source projects.

License

env4config is available under the Apache 2 license. See the LICENSE file for more info.

com.codacy

Codacy

Версии библиотеки

Версия
1.0.1
1.0.0
0.2.4
0.2.3
0.2.2
0.2.1
0.1.1
0.1.0