generic-pipeline
This module contains functions that can be used in multiple pipelinesInstallation
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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | Container to run the lint command |
results | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | Container to run the test command |
results | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
dir | Directory ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
sbom | File ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
sbom | File ! | - | SBOM file |
address | String ! | - | deptrack address for publishing the SBOM https://deptrack.example.com/api/v1/bom |
apiKey | Secret ! | - | deptrack API key |
projectUuid | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | Container to publish |
registryAddress | String ! | - | Registry address to publish to - formatted as [host]/[user]/[repo]:[tag] |
registryUsername | String | "" | Username of the registry's account |
registryPassword | Secret | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
registryUsername | String ! | - | Username of the registry's account |
registryPassword | Secret ! | - | API key, password or token to authenticate to the registry |
digest | String ! | - | 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
Name | Type | Default Value | Description |
---|---|---|---|
registryUsername | String ! | - | Username of the registry's account |
registryPassword | Secret ! | - | API key, password or token to authenticate to the registry |
digest | String ! | - | Container image digest to attest |
predicate | File ! | - | SBOM file |
sbomType | String ! | - | 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)
}