Dagger
Search

determine-environment

This module has been generated via dagger init and serves as a reference to
basic 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@b6431befeb515ac3349b918674895a6fcd31e53b

Entrypoint

Return Type
DetermineEnvironment !
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@b6431befeb515ac3349b918674895a6fcd31e53b 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
NameTypeDefault ValueDescription
sourceDirectory -Source directory containing the project files
branchString -Branch name to check for the environment
mapfileString !"env_map.json"Name of the JSON file containing the environment map
Example
dagger -m github.com/BCIT-LTC/daggerverse/determine-environment@b6431befeb515ac3349b918674895a6fcd31e53b 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)
}