okteto-dagger-module
Okteto CLI and preview environment functions
Installation
dagger install github.com/okteto/dagger-module@v0.0.5
Entrypoint
Return Type
OktetoDaggerModule
Example
dagger -m github.com/okteto/dagger-module@34d38768c738b0d98f06f30e86e1ae51f7f4eb06 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
Name | Type | Default Value | Description |
---|---|---|---|
context | String ! | - | No description provided |
token | String ! | - | No description provided |
Example
dagger -m github.com/okteto/dagger-module@34d38768c738b0d98f06f30e86e1ae51f7f4eb06 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
Name | Type | Default Value | Description |
---|---|---|---|
repo | String ! | - | Repo to deploy |
branch | String ! | - | Branch to deploy |
pr | String ! | - | URL of the pull request to attach in the Okteto Dashboard |
context | String ! | - | Okteto context to be used for deployment |
token | String ! | - | Token to be used to authenticate with the Okteto context |
Example
dagger -m github.com/okteto/dagger-module@34d38768c738b0d98f06f30e86e1ae51f7f4eb06 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
Name | Type | Default Value | Description |
---|---|---|---|
branch | String ! | - | Branch to deploy (to be used as the name for the preview env) |
context | String ! | - | Okteto context to be used for deployment |
token | String ! | - | Token to be used to authenticate with the Okteto context |
Example
dagger -m github.com/okteto/dagger-module@34d38768c738b0d98f06f30e86e1ae51f7f4eb06 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)
}