Dagger
Search

helm

The main focus is to publish new Helm Chart versions on registries.

For accomplishing this the https://helm.sh/ tool is used.

Installation

dagger install github.com/puzzle/dagger-module-helm/helm@v1.0.5

Entrypoint

Return Type
Helm
Example
dagger -m github.com/puzzle/dagger-module-helm/helm@484f7b65de88ec8f801df74711d5e0c48448438f call \
func (m *myModule) example() *Helm  {
	return dag.
			Helm()
}
@function
def example() -> dag.Helm:
	return (
		dag.helm()
	)
@func()
example(): Helm {
	return dag
		.helm()
}

Types

Helm 🔗

version() 🔗

Get and display the version of the Helm Chart located inside the given directory.

Example usage: dagger call version –directory ./examples/testdata/mychart/

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
Example
no available example in current language
func (m *Go) HelmVersion(
	// method call context
	ctx context.Context,
) error {
	const expected = "0.1.1"

	// dagger call version --directory ./examples/testdata/mychart/
	directory := dag.CurrentModule().Source().Directory("./testdata/mychart/")
	version, err := dag.Helm().Version(ctx, directory)

	if err != nil {
		return err
	}

	if version != expected {
		return fmt.Errorf("expected %q, got %q", expected, version)
	}

	return nil
}
no available example in current language
no available example in current language

packagePush() 🔗

Packages and pushes a Helm chart to a specified OCI-compatible registry with authentication.

Returns true if the chart was successfully pushed, or false if the chart already exists, with error handling for push failures.

Example usage:

dagger call package-push \
  --registry registry.puzzle.ch \
  --repository helm \
  --username $REGISTRY_HELM_USER \
  --password env:REGISTRY_HELM_PASSWORD \
  --directory ./examples/testdata/mychart/
Return Type
Boolean !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
registryString !-URL of the registry
repositoryString !-name of the repository
usernameString !-registry login username
passwordSecret !-registry login password
Example
no available example in current language
func (h *Go) HelmPackagepush(
	// method call context
	ctx context.Context,
	// URL of the registry
	registry string,
	// name of the repository
	repository string,
	// registry login username
	username string,
	// registry login password
	password *dagger.Secret,
) error {
	//	dagger call package-push \
	//	  --registry registry.puzzle.ch \
	//	  --repository helm \
	//	  --username $REGISTRY_HELM_USER \
	//	  --password env:REGISTRY_HELM_PASSWORD \
	//	  --directory ./examples/testdata/mychart/

	// directory that contains the Helm Chart
	directory := dag.CurrentModule().Source().Directory("./testdata/mychart/")
	_, err := dag.Helm().PackagePush(ctx, directory, registry, repository, username, password)

	if err != nil {
		return err
	}

	return nil
}
no available example in current language
no available example in current language

test() 🔗

Run Helm unittests with the given directory and files.

Provide the helm chart directory with pointing to it with the --directory flag. Add the directory location with "." as --args parameter to tell helm unittest where to find the helm chart with the tests.

Example usage: dagger call test –directory ./examples/testdata/mychart/ –args “.”

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
args[String ! ] !-Helm Unittest arguments
Example
no available example in current language
func (m *Go) HelmTest(
	// method call context
	ctx context.Context,
) error {
	args := []string{"."}

	// dagger call test --directory ./examples/testdata/mychart/ --args "."
	directory := dag.CurrentModule().Source().Directory("./testdata/mychart/")
	_, err := dag.Helm().Test(ctx, directory, args)

	if err != nil {
		return err
	}

	return nil
}
no available example in current language
no available example in current language