Dagger
Search

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@v0.0.3

Entrypoint

Return Type
DaggerverseCockpit
Example
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

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
NameTypeDefault ValueDescription
versionString "0.10.2"No description provided
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 call \
 cli \
 publish --repository DIR_PATH
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()
}

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
NameTypeDefault ValueDescription
moduleDirectory !-No description provided
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 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)
}

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
NameTypeDefault ValueDescription
repositoryDirectory !-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.
dryRunBoolean -Only returns the path of the modules that shall be published
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 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@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 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
NameTypeDefault ValueDescription
repositoryDirectory !-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.
pathString "."The path to the module to publish
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 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
NameTypeDefault ValueDescription
moduleDirectory !-The module to use the Dagger CLI on.
Example
dagger -m github.com/quartz-technology/daggerverse/daggerverse-cockpit@627fc4df7de8ce3bd8710fa08ea2db6cf16712b3 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)
}