https://github.com/vic/mill-dotenv
A Mill module for twelve-factor apps loading environment variables from a local file.
https://github.com/vic/mill-dotenv
dotenv hacktoberfest mill mill-module twelve-factor
Last synced: 8 months ago
JSON representation
A Mill module for twelve-factor apps loading environment variables from a local file.
- Host: GitHub
- URL: https://github.com/vic/mill-dotenv
- Owner: vic
- License: other
- Created: 2018-09-02T21:24:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-16T17:41:33.000Z (over 3 years ago)
- Last Synced: 2024-04-14T15:09:18.910Z (over 1 year ago)
- Topics: dotenv, hacktoberfest, mill, mill-module, twelve-factor
- Language: Scala
- Homepage:
- Size: 38.1 KB
- Stars: 4
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mill-dotenv
[](https://github.com/vic/mill-dotenv/actions?query=workflow%3A%22Main+workflow%22)
[](https://jitpack.io/#vic/mill-dotenv)A [Mill][mill] module for loading environment variables from a local file.
Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables.
But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. mill-dotenv loads variables from a .env file into ENV when the environment is bootstrapped.
mill-dotenv is intended to be used in development.
## Usage
See the example project buildfile: [`example/build.sc`][example].
### Credits
The regular expression for parsing the env file has been borrowed from [sbt-dotenv] to support exactly the same format.
[mill]: https://www.lihaoyi.com/mill
[sbt-dotenv]: https://github.com/mefellows/sbt-dotenv
[example]: https://github.com/vic/mill-dotenv/blob/master/example/build.sc