flux
Push a directory as a Flux OCI artifact, tag it, and substitute ${VAR}references the way Flux post-build substitution does.
Installation
dagger install github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86Entrypoint
Return Type
Flux !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container | - | container is an existing container with flux on PATH |
| repository | String ! | "ghcr.io/fluxcd/flux-cli" | repository is the Flux CLI image repository |
| tag | String ! | "v2.9.6" | tag is the Flux CLI image tag |
| extraCaCerts | [File ! ] | - | extraCaCerts are additional CA certificate files to trust |
Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag stringfunc (m *MyModule) Example(repository string, tag string) *dagger.Flux {
return dag.
Flux(repository, tag)
}@function
def example(repository: str, tag: str, ) -> dagger.Flux:
return (
dag.flux(repository, tag)
)@func()
example(repository: string, tag: string, ): Flux {
return dag
.flux(repository, tag)
}Types
Flux 🔗
Flux runs Flux CLI commands that need no cluster.
container() 🔗
Return Type
Container ! Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag string containerfunc (m *MyModule) Example(repository string, tag string) *dagger.Container {
return dag.
Flux(repository, tag).
Container()
}@function
def example(repository: str, tag: str, ) -> dagger.Container:
return (
dag.flux(repository, tag)
.container()
)@func()
example(repository: string, tag: string, ): Container {
return dag
.flux(repository, tag)
.container()
}envsubst() 🔗
Envsubst substitutes ${VAR} references in input with vars, like Flux post-build substitution, and returns the result.
Return Type
File !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| input | File ! | - | input is the file to substitute |
| vars | [String ! ] | - | vars are KEY=VALUE pairs |
| strict | Boolean ! | true | strict fails on variables that are referenced but not set |
Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag string envsubst --input file:path --strict booleanfunc (m *MyModule) Example(repository string, tag string, input *dagger.File, strict bool) *dagger.File {
return dag.
Flux(repository, tag).
Envsubst(input, strict)
}@function
def example(repository: str, tag: str, input: dagger.File, strict: bool) -> dagger.File:
return (
dag.flux(repository, tag)
.envsubst(input, strict)
)@func()
example(repository: string, tag: string, input: File, strict: boolean): File {
return dag
.flux(repository, tag)
.envsubst(input, strict)
}pushArtifact() 🔗
PushArtifact pushes source as an OCI artifact and returns its digest URL (oci://repo@sha256:…).
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | source is the directory to package |
| url | String ! | - | url is the artifact URL with tag, e.g. oci://ghcr.io/org/app:v1 |
| sourceUrl | String ! | - | sourceURL is recorded as the artifact’s source, e.g. the git repository URL |
| revision | String ! | - | revision is recorded as the artifact’s revision, e.g. main@sha1: |
| ignorePaths | [String ! ] | - | ignorePaths are .gitignore-style patterns to exclude |
| annotations | [String ! ] | - | annotations are extra OCI annotations as key=value |
| insecure | Boolean | - | insecure allows plain HTTP registries |
Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag string push-artifact --source DIR_PATH --url string --source-url string --revision stringfunc (m *MyModule) Example(ctx context.Context, repository string, tag string, source *dagger.Directory, url string, sourceUrl string, revision string) string {
return dag.
Flux(repository, tag).
Pushartifact(ctx, source, url, sourceUrl, revision)
}@function
async def example(repository: str, tag: str, source: dagger.Directory, url: str, sourceurl: str, revision: str) -> str:
return await (
dag.flux(repository, tag)
.pushartifact(source, url, sourceurl, revision)
)@func()
async example(repository: string, tag: string, source: Directory, url: string, sourceUrl: string, revision: string): Promise<string> {
return dag
.flux(repository, tag)
.pushArtifact(source, url, sourceUrl, revision)
}tagArtifact() 🔗
TagArtifact adds tags to an existing artifact.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| url | String ! | - | url is the artifact URL with tag or digest, e.g. oci://ghcr.io/org/app:sha-abc |
| tags | [String ! ] ! | - | tags are the tags to add |
Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag string tag-artifact --url string --tags string1 --tags string2func (m *MyModule) Example(ctx context.Context, repository string, tag string, url string, tags []string) string {
return dag.
Flux(repository, tag).
Tagartifact(ctx, url, tags)
}@function
async def example(repository: str, tag: str, url: str, tags: List[str]) -> str:
return await (
dag.flux(repository, tag)
.tagartifact(url, tags)
)@func()
async example(repository: string, tag: string, url: string, tags: string[]): Promise<string> {
return dag
.flux(repository, tag)
.tagArtifact(url, tags)
}withRegistryAuth() 🔗
WithRegistryAuth sets credentials for an OCI registry, used by PushArtifact and TagArtifact.
Return Type
Flux !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| address | String ! | - | address is the registry host, e.g. ghcr.io |
| username | String ! | - | username is the registry user |
| secret | Secret ! | - | secret is the registry password or token |
Example
dagger -m github.com/hampusctl/daggerverse/flux@1b08831096058e8c3abb47cdde51e51663023d86 call \
--repository string --tag string with-registry-auth --address string --username string --secret env:MYSECRETfunc (m *MyModule) Example(repository string, tag string, address string, username string, secret *dagger.Secret) *dagger.Flux {
return dag.
Flux(repository, tag).
Withregistryauth(address, username, secret)
}@function
def example(repository: str, tag: str, address: str, username: str, secret: dagger.Secret) -> dagger.Flux:
return (
dag.flux(repository, tag)
.withregistryauth(address, username, secret)
)@func()
example(repository: string, tag: string, address: string, username: string, secret: Secret): Flux {
return dag
.flux(repository, tag)
.withRegistryAuth(address, username, secret)
}