Dagger
Search

okteto-dagger-module

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/okteto/dagger-module@v0.0.4

Entrypoint

Return Type
OktetoDaggerModule
Example
func (m *myModule) example() *OktetoDaggerModule  {
	return dag.
			OktetoDaggerModule()
}
@function
def example() -> dag.OktetoDaggerModule:
	return (
		dag.okteto_dagger_module()
	)
@func()
example(): OktetoDaggerModule {
	return dag
		.oktetoDaggerModule()
}

Types

OktetoDaggerModule 🔗

setContext() 🔗

example usage: dagger -m call set-context –context=yourinstance.okteto.com –token=$OKTETO_TOKEN

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
contextString !-No description provided
tokenString !-No description provided
Example
func (m *myModule) example(context string, token string) *Container  {
	return dag.
			OktetoDaggerModule().
			SetContext(context, token)
}
@function
def example(context: str, token: str) -> dagger.Container:
	return (
		dag.okteto_dagger_module()
		.set_context(context, token)
	)
@func()
example(context: string, token: string): Container {
	return dag
		.oktetoDaggerModule()
		.setContext(context, token)
}

previewDeploy() 🔗

example usage: dagger call preview-deploy –repo=https://github.com/RinkiyaKeDad/okteto-dagger-sample –branch=name-change –pr=https://github.com/RinkiyaKeDad/okteto-dagger-sample/pull/1 –context=yourinstance.okteto.com –token=$OKTETO_TOKEN

Return Type
String !
Arguments
NameTypeDefault ValueDescription
repoString !-Repo to deploy
branchString !-Branch to deploy
prString !-URL of the pull request to attach in the Okteto Dashboard
contextString !-Okteto context to be used for deployment
tokenString !-Token to be used to authenticate with the Okteto context
Example
func (m *myModule) example(ctx context.Context, repo string, branch string, pr string, context string, token string) string  {
	return dag.
			OktetoDaggerModule().
			PreviewDeploy(ctx, repo, branch, pr, context, token)
}
@function
async def example(repo: str, branch: str, pr: str, context: str, token: str) -> str:
	return await (
		dag.okteto_dagger_module()
		.preview_deploy(repo, branch, pr, context, token)
	)
@func()
async example(repo: string, branch: string, pr: string, context: string, token: string): Promise<string> {
	return dag
		.oktetoDaggerModule()
		.previewDeploy(repo, branch, pr, context, token)
}

previewDestroy() 🔗

example usage: dagger call preview-destroy –branch=name-change –context=yourinstance.okteto.com –token=$OKTETO_TOKEN

Return Type
String !
Arguments
NameTypeDefault ValueDescription
branchString !-Branch to deploy (to be used as the name for the preview env)
contextString !-Okteto context to be used for deployment
tokenString !-Token to be used to authenticate with the Okteto context
Example
func (m *myModule) example(ctx context.Context, branch string, context string, token string) string  {
	return dag.
			OktetoDaggerModule().
			PreviewDestroy(ctx, branch, context, token)
}
@function
async def example(branch: str, context: str, token: str) -> str:
	return await (
		dag.okteto_dagger_module()
		.preview_destroy(branch, context, token)
	)
@func()
async example(branch: string, context: string, token: string): Promise<string> {
	return dag
		.oktetoDaggerModule()
		.previewDestroy(branch, context, token)
}