determine-environment
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/BCIT-LTC/daggerverse/determine-environment@a5b4a8de8c02660795f50c27334b9d361826d37e
Entrypoint
Return Type
DetermineEnvironment !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
gitContainer | Container | - | An OCI-compatible container, also known as a Docker container. |
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@a5b4a8de8c02660795f50c27334b9d361826d37e call \
func (m *myModule) example() *dagger.DetermineEnvironment {
return dag.
DetermineEnvironment()
}
@function
def example() -> dagger.DetermineEnvironment:
return (
dag.determine_environment()
)
@func()
example(): DetermineEnvironment {
return dag
.determineEnvironment()
}
Types
DetermineEnvironment 🔗
Object type for determining the CI environment
gitContainer() 🔗
An OCI-compatible container, also known as a Docker container.
Return Type
Container !
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@a5b4a8de8c02660795f50c27334b9d361826d37e call \
git-container
func (m *myModule) example() *dagger.Container {
return dag.
DetermineEnvironment().
GitContainer()
}
@function
def example() -> dagger.Container:
return (
dag.determine_environment()
.git_container()
)
@func()
example(): Container {
return dag
.determineEnvironment()
.gitContainer()
}
getenv() 🔗
Determine the environment of the project
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Source directory containing the project files |
branch | String | - | Branch name to check for the environment |
mapfile | String ! | "env_map.json" | Name of the JSON file containing the environment map |
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@a5b4a8de8c02660795f50c27334b9d361826d37e call \
getenv --mapfile string
func (m *myModule) example(ctx context.Context, mapfile string) string {
return dag.
DetermineEnvironment().
Getenv(ctxmapfile)
}
@function
async def example(mapfile: str) -> str:
return await (
dag.determine_environment()
.getenv(mapfile)
)
@func()
async example(mapfile: string): Promise<string> {
return dag
.determineEnvironment()
.getenv(mapfile)
}