daggerverse-cockpit
Daggerverse Cockpit aims to provide a simple and easy to use interface to manage your Daggerverse repository.It provides single commands action to publish all your modules, generate usage example, get a dagger CLI and more!
Installation
dagger install github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390
Entrypoint
Return Type
DaggerverseCockpit
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
func (m *myModule) example() *DaggerverseCockpit {
return dag.
DaggerverseCockpit()
}
@function
def example() -> dag.DaggerverseCockpit:
return (
dag.daggerverse_cockpit()
)
@func()
example(): DaggerverseCockpit {
return dag
.daggerverseCockpit()
}
Types
DaggerverseCockpit 🔗
usageGenerator() 🔗
UsageGenerator generates a simple usage documentation for a module.
This function is still in developement, it’s a simple utility functions to simplify modules maintaing.
Use it as a starting point for your module README but please, do not consider it as a README generator.
Example usage: dagger call usage-generator –module=. -o USAGE.md
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
module | Directory ! | - | No description provided |
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
usage-generator --module DIR_PATH
func (m *myModule) example(module *Directory) *File {
return dag.
DaggerverseCockpit().
UsageGenerator(module)
}
@function
def example(module: dagger.Directory) -> dagger.File:
return (
dag.daggerverse_cockpit()
.usage_generator(module)
)
@func()
example(module: Directory): File {
return dag
.daggerverseCockpit()
.usageGenerator(module)
}
cli() 🔗
CLI installs the Dagger CLI in a container and returns it.
Make sure to set the version
to the desired Dagger version.
You may also need to enable Experimental Privileged Nesting
in your container to make it works.
Example usage:
dagger call cli --version=0.10.2 with-exec --args="version" stdout
Return Type
DaggerverseCockpitCli !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "0.10.2" | No description provided |
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
cli
func (m *myModule) example() *DaggerverseCockpitCli {
return dag.
DaggerverseCockpit().
Cli()
}
@function
def example() -> dag.DaggerverseCockpitCli:
return (
dag.daggerverse_cockpit()
.cli()
)
@func()
example(): DaggerverseCockpitCli {
return dag
.daggerverseCockpit()
.cli()
}
publish() 🔗
Publish loop through all your directory that contains a dagger.json
and publish them to the daggerverse.
Example usage: dagger call publish --repository=. --exclude="deprecated"
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repository | Directory ! | - | The repository that contains your dagger modules |
exclude | [String ! ] | - | Excluse some directories from publishing It's useful if you use this module from Dagger CLI. |
dryRun | Boolean | - | Only returns the path of the modules that shall be published |
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
publish --repository DIR_PATH
func (m *myModule) example(ctx context.Context, repository *Directory) []string {
return dag.
DaggerverseCockpit().
Publish(ctx, repository)
}
@function
async def example(repository: dagger.Directory) -> List[str]:
return await (
dag.daggerverse_cockpit()
.publish(repository)
)
@func()
async example(repository: Directory): Promise<string[]> {
return dag
.daggerverseCockpit()
.publish(repository)
}
DaggerverseCockpitCli 🔗
CLI is an abstraction to the Dagger CLI so you can use it inside a container for high level management command.
container() 🔗
The Dagger CLI container
Return Type
Container !
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
cli \
container
func (m *myModule) example() *Container {
return dag.
DaggerverseCockpit().
Cli().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.daggerverse_cockpit()
.cli()
.container()
)
@func()
example(): Container {
return dag
.daggerverseCockpit()
.cli()
.container()
}
publish() 🔗
Publish executes the publish command to upload the module to the Daggerverse. This function returns the URL of the published module. Example usage: dagger call cli publish –repository=.
You could also use it directly in your code: repository := // … your module repository fetched from arguments or git url, err := dag.DaggerCockpit().CLI().Publish(ctx, repository, “.”) if err != nil {…} // Handle error fmt.Println(url)
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
repository | Directory ! | - | The repository to use the Dagger CLI on. Dagger expect the `.git` directories to be inside this directory. Specify a subpath if your module is located in a child directory. |
path | String | "." | The path to the module to publish |
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
cli \
publish --repository DIR_PATH
func (m *myModule) example(ctx context.Context, repository *Directory) string {
return dag.
DaggerverseCockpit().
Cli().
Publish(ctx, repository)
}
@function
async def example(repository: dagger.Directory) -> str:
return await (
dag.daggerverse_cockpit()
.cli()
.publish(repository)
)
@func()
async example(repository: Directory): Promise<string> {
return dag
.daggerverseCockpit()
.cli()
.publish(repository)
}
develop() 🔗
Develop executes the develop command to start a development environment for the module and returns its content.
Example usage: dagger call cli develop –module=. -o .
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
module | Directory ! | - | The module to use the Dagger CLI on. |
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@6be53287110567fb5c9558f56189178ff0d2d390 call \
cli \
develop --module DIR_PATH
func (m *myModule) example(module *Directory) *Directory {
return dag.
DaggerverseCockpit().
Cli().
Develop(module)
}
@function
def example(module: dagger.Directory) -> dagger.Directory:
return (
dag.daggerverse_cockpit()
.cli()
.develop(module)
)
@func()
example(module: Directory): Directory {
return dag
.daggerverseCockpit()
.cli()
.develop(module)
}