magicenv
Most of modern application use environment to configure runtime variable, such asdatabase connection, API key, etc.
Usually, they are store in a file, such as .env, .env.local, .env.development, or .envrc.
This package provides a way to inject those environment into a container so you do not have
to redifine all your variable when you "daggerize" your application.
Installation
dagger install github.com/quartz-technology/daggerverse/magicenv@v0.0.3
Entrypoint
Return Type
Magicenv
Example
dagger -m github.com/quartz-technology/daggerverse/magicenv@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 call \
func (m *myModule) example() *Magicenv {
return dag.
Magicenv()
}
@function
def example() -> dag.Magicenv:
return (
dag.magicenv()
)
@func()
example(): Magicenv {
return dag
.magicenv()
}
Types
Magicenv 🔗
loadEnv() 🔗
Load environment from a .env or .envrc type of tile and inject it into a container.
All variables are loaded as plaintext so be careful with sensitive secrets.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | The container to inject the environment in. |
path | String | ".env" | The path to the environment file to load. |
Example
dagger -m github.com/quartz-technology/daggerverse/magicenv@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 call \
load-env --ctr IMAGE:TAG
func (m *myModule) example(ctr *Container) *Container {
return dag.
Magicenv().
LoadEnv(ctr)
}
@function
def example(ctr: dagger.Container) -> dagger.Container:
return (
dag.magicenv()
.load_env(ctr)
)
@func()
example(ctr: Container): Container {
return dag
.magicenv()
.loadEnv(ctr)
}