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@af5b1b80fe243f994544ebd0f736ce40fcd201c6
Entrypoint
Return Type
DetermineEnvironment !
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@af5b1b80fe243f994544ebd0f736ce40fcd201c6 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
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@af5b1b80fe243f994544ebd0f736ce40fcd201c6 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)
}