okteto-dagger-module
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/okteto/dagger-module@v0.0.4
Entrypoint
Return Type
OktetoDaggerModule
Example
dagger -m github.com/okteto/dagger-module@4d6d3b4d954e27e707b208d3d8bee0d986fe4d2d 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@4d6d3b4d954e27e707b208d3d8bee0d986fe4d2d 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@4d6d3b4d954e27e707b208d3d8bee0d986fe4d2d 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@4d6d3b4d954e27e707b208d3d8bee0d986fe4d2d 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)
}