dagger-techlab-module
The functions are used inside the hands-on lab: https://dagger-techlab.puzzle.ch/Installation
dagger install github.com/puzzle/dagger-techlab/mod@v1.0.0
Entrypoint
Return Type
DaggerTechlabModule
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
func (m *myModule) example() *DaggerTechlabModule {
return dag.
DaggerTechlabModule()
}
@function
def example() -> dag.DaggerTechlabModule:
return (
dag.dagger_techlab_module()
)
@func()
example(): DaggerTechlabModule {
return dag
.daggerTechlabModule()
}
Types
DaggerTechlabModule 🔗
hello() 🔗
Say hello to the world! Calls external module Hello https://github.com/shykes/hello
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
greeting | String | "hello" | Change the greeting |
name | String | "world" | Change the name |
giant | Boolean | - | Encode the message in giant multi-character letters |
shout | Boolean | - | Make the message uppercase, and add more exclamation points |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
hello
func (m *myModule) example(ctx context.Context) string {
return dag.
DaggerTechlabModule().
Hello(ctx)
}
@function
async def example() -> str:
return await (
dag.dagger_techlab_module()
.hello()
)
@func()
async example(): Promise<string> {
return dag
.daggerTechlabModule()
.hello()
}
ls() 🔗
Returns the files of the directory
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | directory to list it's files |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
ls --dir DIR_PATH
func (m *myModule) example(ctx context.Context, dir *Directory) string {
return dag.
DaggerTechlabModule().
Ls(ctx, dir)
}
@function
async def example(dir: dagger.Directory) -> str:
return await (
dag.dagger_techlab_module()
.ls(dir)
)
@func()
async example(dir: Directory): Promise<string> {
return dag
.daggerTechlabModule()
.ls(dir)
}
os() 🔗
Returns the operating system of the container
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | container to get it's OS |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
os --ctr IMAGE:TAG
func (m *myModule) example(ctx context.Context, ctr *Container) string {
return dag.
DaggerTechlabModule().
Os(ctx, ctr)
}
@function
async def example(ctr: dagger.Container) -> str:
return await (
dag.dagger_techlab_module()
.os(ctr)
)
@func()
async example(ctr: Container): Promise<string> {
return dag
.daggerTechlabModule()
.os(ctr)
}
unlock() 🔗
Returns the answer to everything when the password is right
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
password | Secret ! | - | No description provided |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
unlock --password env:MYSECRET
func (m *myModule) example(ctx context.Context, password *Secret) string {
return dag.
DaggerTechlabModule().
Unlock(ctx, password)
}
@function
async def example(password: dagger.Secret) -> str:
return await (
dag.dagger_techlab_module()
.unlock(password)
)
@func()
async example(password: Secret): Promise<string> {
return dag
.daggerTechlabModule()
.unlock(password)
}
sshService() 🔗
Returns a service that runs an OpenSSH server Calls external module OpensshServer https://github.com/sagikazarmark/daggerverse/tree/main/openssh-server
Return Type
Service !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
port | Integer | 22 | No description provided |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
ssh-service
func (m *myModule) example() *Service {
return dag.
DaggerTechlabModule().
SshService()
}
@function
def example() -> dagger.Service:
return (
dag.dagger_techlab_module()
.ssh_service()
)
@func()
example(): Service {
return dag
.daggerTechlabModule()
.sshService()
}
lint() 🔗
Lint a Python codebase Calls external module Ruff https://github.com/dagger/dagger/tree/main/modules/ruff
Return Type
DaggerTechlabModuleLintRun !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
lint --source DIR_PATH
func (m *myModule) example(source *Directory) *DaggerTechlabModuleLintRun {
return dag.
DaggerTechlabModule().
Lint(source)
}
@function
def example(source: dagger.Directory) -> dag.DaggerTechlabModuleLintRun:
return (
dag.dagger_techlab_module()
.lint(source)
)
@func()
example(source: Directory): DaggerTechlabModuleLintRun {
return dag
.daggerTechlabModule()
.lint(source)
}
wolfi() 🔗
Build a Wolfi Linux container Calls external module Wolfi https://github.com/shykes/daggerverse/tree/main/wolfi
Return Type
Container !
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
wolfi
func (m *myModule) example() *Container {
return dag.
DaggerTechlabModule().
Wolfi()
}
@function
def example() -> dagger.Container:
return (
dag.dagger_techlab_module()
.wolfi()
)
@func()
example(): Container {
return dag
.daggerTechlabModule()
.wolfi()
}
DaggerTechlabModuleLintRun 🔗
report() 🔗
Returns a JSON report file for this run
Return Type
File !
Example
dagger -m github.com/puzzle/dagger-techlab/mod@abade4173699f5454d9ec869ff09ca0f094857a6 call \
lint --source DIR_PATH \
report
func (m *myModule) example(source *Directory) *File {
return dag.
DaggerTechlabModule().
Lint(source).
Report()
}
@function
def example(source: dagger.Directory) -> dagger.File:
return (
dag.dagger_techlab_module()
.lint(source)
.report()
)
@func()
example(source: Directory): File {
return dag
.daggerTechlabModule()
.lint(source)
.report()
}