Dagger
Search

generic-pipeline

This module contains functions that can be used in multiple pipelines

Installation

dagger install github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@v0.0.1

Entrypoint

Return Type
GenericPipeline
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
func (m *myModule) example() *GenericPipeline  {
	return dag.
			GenericPipeline()
}
@function
def example() -> dag.GenericPipeline:
	return (
		dag.generic_pipeline()
	)
@func()
example(): GenericPipeline {
	return dag
		.genericPipeline()
}

Types

GenericPipeline 🔗

lint() 🔗

Returns a file containing the results of the lint command

Return Type
File !
Arguments
NameTypeDefault ValueDescription
containerContainer !-Container to run the lint command
resultsString !-Path to file containing lint results
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 lint --container IMAGE:TAG --results string
func (m *myModule) example(container *Container, results string) *File  {
	return dag.
			GenericPipeline().
			Lint(container, results)
}
@function
def example(container: dagger.Container, results: str) -> dagger.File:
	return (
		dag.generic_pipeline()
		.lint(container, results)
	)
@func()
example(container: Container, results: string): File {
	return dag
		.genericPipeline()
		.lint(container, results)
}

test() 🔗

Returns a directory containing the results of the test command

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
containerContainer !-Container to run the test command
resultsString !-Path to directory containing test results
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 test --container IMAGE:TAG --results string
func (m *myModule) example(container *Container, results string) *Directory  {
	return dag.
			GenericPipeline().
			Test(container, results)
}
@function
def example(container: dagger.Container, results: str) -> dagger.Directory:
	return (
		dag.generic_pipeline()
		.test(container, results)
	)
@func()
example(container: Container, results: string): Directory {
	return dag
		.genericPipeline()
		.test(container, results)
}

build() 🔗

Returns a Container built from the Dockerfile in the provided Directory

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 build --dir DIR_PATH
func (m *myModule) example(dir *Directory) *Container  {
	return dag.
			GenericPipeline().
			Build(dir)
}
@function
def example(dir: dagger.Directory) -> dagger.Container:
	return (
		dag.generic_pipeline()
		.build(dir)
	)
@func()
example(dir: Directory): Container {
	return dag
		.genericPipeline()
		.build(dir)
}

sbomBuild() 🔗

Builds the container and creates a SBOM for it

Return Type
File !
Arguments
NameTypeDefault ValueDescription
dirDirectory !-No description provided
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 sbom-build --dir DIR_PATH
func (m *myModule) example(dir *Directory) *File  {
	return dag.
			GenericPipeline().
			SbomBuild(dir)
}
@function
def example(dir: dagger.Directory) -> dagger.File:
	return (
		dag.generic_pipeline()
		.sbom_build(dir)
	)
@func()
example(dir: Directory): File {
	return dag
		.genericPipeline()
		.sbomBuild(dir)
}

sbom() 🔗

Creates a SBOM for the container

Return Type
File !
Arguments
NameTypeDefault ValueDescription
containerContainer !-No description provided
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 sbom --container IMAGE:TAG
func (m *myModule) example(container *Container) *File  {
	return dag.
			GenericPipeline().
			Sbom(container)
}
@function
def example(container: dagger.Container) -> dagger.File:
	return (
		dag.generic_pipeline()
		.sbom(container)
	)
@func()
example(container: Container): File {
	return dag
		.genericPipeline()
		.sbom(container)
}

vulnscan() 🔗

Scans the SBOM for vulnerabilities

Return Type
File !
Arguments
NameTypeDefault ValueDescription
sbomFile !-No description provided
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 vulnscan --sbom file:path
func (m *myModule) example(sbom *File) *File  {
	return dag.
			GenericPipeline().
			Vulnscan(sbom)
}
@function
def example(sbom: dagger.File) -> dagger.File:
	return (
		dag.generic_pipeline()
		.vulnscan(sbom)
	)
@func()
example(sbom: File): File {
	return dag
		.genericPipeline()
		.vulnscan(sbom)
}

publishToDeptrack() 🔗

Publish cyclonedx SBOM to Deptrack

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sbomFile !-SBOM file
addressString !-deptrack address for publishing the SBOM https://deptrack.example.com/api/v1/bom
apiKeySecret !-deptrack API key
projectUuidString !-deptrack project UUID
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 publish-to-deptrack --sbom file:path --address string --api-key env:MYSECRET --project-uuid string
func (m *myModule) example(ctx context.Context, sbom *File, address string, apiKey *Secret, projectUuid string) string  {
	return dag.
			GenericPipeline().
			PublishToDeptrack(ctx, sbom, address, apiKey, projectUuid)
}
@function
async def example(sbom: dagger.File, address: str, api_key: dagger.Secret, project_uuid: str) -> str:
	return await (
		dag.generic_pipeline()
		.publish_to_deptrack(sbom, address, api_key, project_uuid)
	)
@func()
async example(sbom: File, address: string, apiKey: Secret, projectUuid: string): Promise<string> {
	return dag
		.genericPipeline()
		.publishToDeptrack(sbom, address, apiKey, projectUuid)
}

publish() 🔗

Publish the provided Container to the provided registry

Return Type
String !
Arguments
NameTypeDefault ValueDescription
containerContainer !-Container to publish
registryAddressString !-Registry address to publish to - formatted as [host]/[user]/[repo]:[tag]
registryUsernameString ""Username of the registry's account
registryPasswordSecret -API key, password or token to authenticate to the registry
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 publish --container IMAGE:TAG --registry-address string
func (m *myModule) example(ctx context.Context, container *Container, registryAddress string) string  {
	return dag.
			GenericPipeline().
			Publish(ctx, container, registryAddress)
}
@function
async def example(container: dagger.Container, registry_address: str) -> str:
	return await (
		dag.generic_pipeline()
		.publish(container, registry_address)
	)
@func()
async example(container: Container, registryAddress: string): Promise<string> {
	return dag
		.genericPipeline()
		.publish(container, registryAddress)
}

sign() 🔗

Sign the published image using cosign (keyless)

Return Type
String !
Arguments
NameTypeDefault ValueDescription
registryUsernameString !-Username of the registry's account
registryPasswordSecret !-API key, password or token to authenticate to the registry
digestString !-Container image digest to sign
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 sign --registry-username string --registry-password env:MYSECRET --digest string
func (m *myModule) example(ctx context.Context, registryUsername string, registryPassword *Secret, digest string) string  {
	return dag.
			GenericPipeline().
			Sign(ctx, registryUsername, registryPassword, digest)
}
@function
async def example(registry_username: str, registry_password: dagger.Secret, digest: str) -> str:
	return await (
		dag.generic_pipeline()
		.sign(registry_username, registry_password, digest)
	)
@func()
async example(registryUsername: string, registryPassword: Secret, digest: string): Promise<string> {
	return dag
		.genericPipeline()
		.sign(registryUsername, registryPassword, digest)
}

attest() 🔗

Attests the SBOM using cosign (keyless)

Return Type
String !
Arguments
NameTypeDefault ValueDescription
registryUsernameString !-Username of the registry's account
registryPasswordSecret !-API key, password or token to authenticate to the registry
digestString !-Container image digest to attest
predicateFile !-SBOM file
sbomTypeString !-SBOM type
Example
dagger -m github.com/puzzle/dagger-module-generic-pipeline/generic-pipeline@8ee4abfcf5b4e3f76ee1c9d50e0b8bcc1834f7ca call \
 attest --registry-username string --registry-password env:MYSECRET --digest string --predicate file:path --sbom-type string
func (m *myModule) example(ctx context.Context, registryUsername string, registryPassword *Secret, digest string, predicate *File, sbomType string) string  {
	return dag.
			GenericPipeline().
			Attest(ctx, registryUsername, registryPassword, digest, predicate, sbomType)
}
@function
async def example(registry_username: str, registry_password: dagger.Secret, digest: str, predicate: dagger.File, sbom_type: str) -> str:
	return await (
		dag.generic_pipeline()
		.attest(registry_username, registry_password, digest, predicate, sbom_type)
	)
@func()
async example(registryUsername: string, registryPassword: Secret, digest: string, predicate: File, sbomType: string): Promise<string> {
	return dag
		.genericPipeline()
		.attest(registryUsername, registryPassword, digest, predicate, sbomType)
}