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/frizzr/dagger-module-helm/helm@022b7559d598073f17f6cd553185c39bb1b6575e

Entrypoint

Return Type
Helm
Example
dagger -m github.com/frizzr/dagger-module-helm/helm@022b7559d598073f17f6cd553185c39bb1b6575e call \
func (m *MyModule) Example() *dagger.Helm  {
	return dag.
			Helm()
}
@function
def example() -> dagger.Helm:
	return (
		dag.helm()
	)
@func()
example(): Helm {
	return dag
		.helm()
}

Types

Helm 🔗

directory() 🔗

Return Type
Directory !
Example
dagger -m github.com/frizzr/dagger-module-helm/helm@022b7559d598073f17f6cd553185c39bb1b6575e call \
 directory
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Helm().
			Directory()
}
@function
def example() -> dagger.Directory:
	return (
		dag.helm()
		.directory()
	)
@func()
example(): Directory {
	return dag
		.helm()
		.directory()
}

name() 🔗

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

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

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
Example
dagger -m github.com/frizzr/dagger-module-helm/helm@022b7559d598073f17f6cd553185c39bb1b6575e call \
 name --directory DIR_PATH
func (m *MyModule) Example(ctx context.Context, directory *dagger.Directory) string  {
	return dag.
			Helm().
			Name(ctx, directory)
}
@function
async def example(directory: dagger.Directory) -> str:
	return await (
		dag.helm()
		.name(directory)
	)
@func()
async example(directory: Directory): Promise<string> {
	return dag
		.helm()
		.name(directory)
}

version() 🔗

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

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

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
Example
no available example in current language
// Example on how to call the Version method.
// 
// Get and display the version of the Helm Chart located inside the directory referenced by the directory parameter.
//
// Return: The Helm Chart version as string.
func (m *Examples) HelmVersion(
	// method call context
	ctx context.Context,
	// directory that contains the Helm Chart, e.g. "./helm/examples/testdata/mychart/"
	chart *dagger.Directory,
) (string, error) {
	return dag.
			Helm().
			Version(ctx, chart)
}
no available example in current language
no available example in current language

appVersion() 🔗

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

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

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
Example
dagger -m github.com/frizzr/dagger-module-helm/helm@022b7559d598073f17f6cd553185c39bb1b6575e call \
 app-version --directory DIR_PATH
func (m *MyModule) Example(ctx context.Context, directory *dagger.Directory) string  {
	return dag.
			Helm().
			AppVersion(ctx, directory)
}
@function
async def example(directory: dagger.Directory) -> str:
	return await (
		dag.helm()
		.app_version(directory)
	)
@func()
async example(directory: Directory): Promise<string> {
	return dag
		.helm()
		.appVersion(directory)
}

packagePush() 🔗

Packages and pushes a Helm chart to a specified OCI-compatible (by default) registry with authentication.

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

If the chart you want to push has dependencies, then we will assume you will be using the same set of credentials given with --username and --password for each and every dependency in your parent chart and we will automatically log into the registry for each dependency if the registry differs from the --registry argument.

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/

Example usage for pushing to a legacy (non-OCI) Helm repository assuming the repo name is ‘helm’. If your target URL requires a vendor-specific path prefix (for example, JFrog Artifactory usually requires ‘artifactory’ before the repo name) then add it before the repository name. If you want to push the chart into a subpath in the repository, then use non-oci-repo-subpath. If the non-oci-repo-subpath option is used, specifying use-non-oci-helm-repo as true is optional.

Example usage without a subpath and with a subpath of ‘optional/subpath/in/repository’:

dagger call package-push \
	--registry registry.puzzle.ch \
	--repository vendor-specific-prefix/helm \
	--username $REGISTRY_HELM_USER \
	--password env:REGISTRY_HELM_PASSWORD \
	--directory ./examples/testdata/mychart/ \
	--use-non-oci-helm-repo=true

dagger call package-push \
	--registry registry.puzzle.ch \
	--repository vendor-specific-prefix/helm \
	--username $REGISTRY_HELM_USER \
	--password env:REGISTRY_HELM_PASSWORD \
	--directory ./examples/testdata/mychart/ \
	--non-oci-repo-subpath optional/subpath/in/repository
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
useNonOciHelmRepoBoolean falseuse a non-OCI (legacy) Helm repository
nonOciRepoSubpathString ""when using a non-OCI Helm repository, optionally specify a subpath location in the repository
setVersionToString -set chart version when packaging default=""
setAppVersionToString -set chart appVersion when packaging default=""
Example
no available example in current language
// Example on how to call the PackagePush method.
// Packages and pushes a Helm chart to a specified OCI-compatible registry with authentication.
//
// Return: true if the chart was successfully pushed, or false if the chart already exists, with error handling for push failures.
func (h *Examples) HelmPackagepush(
	// method call context
	ctx context.Context,
	// directory that contains the Helm Chart
	directory *dagger.Directory,
	// URL of the registry
	registry string,
	// name of the repository
	repository string,
	// registry login username
	username string,
	// registry login password
	password *dagger.Secret,
) (bool, error) {
	return dag.
			Helm().
			PackagePush(ctx, directory, registry, repository, username, password)
}
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 ./helm/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
// Example on how to call the Test method.
//
// Run the unit tests for the Helm Chart located inside the directory referenced by the directory parameter.
// Add the directory location with `"."` as `--args` parameter to tell helm unittest where to find the tests inside the passed directory.
//
// Return: The Helm unit test output as string.
func (h *Examples) HelmTest(
	// method call context
	ctx context.Context,
	// directory that contains the Helm Chart, e.g. "./helm/examples/testdata/mychart/"
	directory *dagger.Directory,
	// Helm Unittest arguments, e.g. "." to reference the Helm Chart root directory inside the passed directory.
	args []string,
) (string, error) {
	return dag.
			Helm().
			Test(ctx, directory, args)
}
no available example in current language
no available example in current language

lint() 🔗

Run Helm lint with the given directory.

Provide the helm chart directory with pointing to it with the --directory flag. Use --args parameter to pass alternative chart locations or additional options to Helm lint - see https://helm.sh/docs/helm/helm_lint/#options

If you need to be able to pull dependent charts but you need to supply credentials for them, then you can optionally supply the --username and --password parameters. In this case, this function will assume you will be using the same set of credentials for each and every dependency in your parent chart and will automatically log into the registry for each dependency. If you are using non-OCI Helm repositories, you can also specify the --use-non-oci-helm-repo parameter to use the legacy Helm repository format.

Example usage without supplying credentials:

dagger call lint –directory ./helm/examples/testdata/mychart/ –args “–quiet”

Return Type
String !
Arguments
NameTypeDefault ValueDescription
directoryDirectory !-directory that contains the Helm Chart
args[String ! ] -Helm lint arguments
usernameString -supplemental credentials for dependent charts - username
passwordSecret -supplemental credentials for dependent charts - password
useNonOciHelmRepoBoolean falseuse a non-OCI (legacy) Helm repository when pulling dependent charts
Example
no available example in current language
// Example on how to call the Lint method.
//
// Run helm lint for the Helm Chart located inside the directory referenced by the directory parameter.
// Use `--args` parameter to pass alternative chart locations or additional options to Helm lint - see https://helm.sh/docs/helm/helm_lint/#options
//
// Return: The Helm lint output as string.
func (h *Examples) HelmLint(
	// method call context
	ctx context.Context,
	// directory that contains the Helm Chart, e.g. "./helm/examples/testdata/mychart/"
	directory *dagger.Directory,
    // Helm lint arguments
    // +optional
	args []string,
) (string, error) {
	return dag.
			Helm().
			Lint(ctx, directory)
}
no available example in current language
no available example in current language