Dagger
Search

okteto-dagger-module

Preview environments give you a sharable URL for each pull request made so you and everyone on your team can view the changes deployed before they get merged
Read more here: https://www.okteto.com/preview-environments/

Installation

dagger install github.com/jpadams/dagger-module@0a4548d4b2f7bc0e3d942151c8f86008559a8a07

Entrypoint

Return Type
OktetoDaggerModule
Example
dagger -m github.com/jpadams/dagger-module@0a4548d4b2f7bc0e3d942151c8f86008559a8a07 call \
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
dagger -m github.com/jpadams/dagger-module@0a4548d4b2f7bc0e3d942151c8f86008559a8a07 call \
 set-context --context string --token string
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
dagger -m github.com/jpadams/dagger-module@0a4548d4b2f7bc0e3d942151c8f86008559a8a07 call \
 preview-deploy --repo string --branch string --pr string --context string --token string
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
dagger -m github.com/jpadams/dagger-module@0a4548d4b2f7bc0e3d942151c8f86008559a8a07 call \
 preview-destroy --branch string --context string --token string
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)
}