Giter Club home page Giter Club logo

Comments (5)

paulschwarz avatar paulschwarz commented on May 27, 2024 1

I would encourage you to read this thread cdimascio/java-dotenv#6 and https://12factor.net/config

Dotenv simply loads variables from the environment, but for developer convenience, it supports loading from your local .env file. This file is not committed to source control, which means that you control your local development environment. For production, you feed in the environment variables via your deployment pipeline.

Spring properties is a sophisticated mechanism to import properties (from wherever) into your java code so you can programmatically utillise those values. Spring supports loading these values from .properties, .yml, but can be extended to load from a remote source, for example.

The project spring-dotenv works together with java-dotenv to configure dotenv as a Spring property source.

Does that help?

from dotenv-kotlin.

paulschwarz avatar paulschwarz commented on May 27, 2024 1

TLDR: yes, correct.

"A litmus test for whether an app has all config correctly factored out of the code is whether the codebase could be made open source at any moment, without compromising any credentials."
-- https://12factor.net/config

"But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. dotenv loads variables from a .env file into ENV when the environment is bootstrapped."
-- https://github.com/bkeepers/dotenv

Spring supports configuration profiles, but...
"This method does not scale cleanly: as more deploys of the app are created, new environment names are necessary, such as staging or qa. As the project grows further, developers may add their own special environments like joes-staging, resulting in a combinatorial explosion of config which makes managing deploys of the app very brittle."
-- https://12factor.net/config

from dotenv-kotlin.

adian avatar adian commented on May 27, 2024

So the only benefit of using java-dotenv is loading environments from local .env file?

from dotenv-kotlin.

adian avatar adian commented on May 27, 2024

I didn't think about the disadvantages of profiles. Thank you for answers 🎉

from dotenv-kotlin.

cdimascio avatar cdimascio commented on May 27, 2024

Thanks @paulschwarz

from dotenv-kotlin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.