artifactory
This module provides functions for uploading build artifacts and related files to your Artifactory instanceInstallation
dagger install github.com/kpenfound/dag/artifactory@v1.0.1Entrypoint
Return Type
Artifactory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| accessToken | Secret ! | - | Artifactory access token |
| url | String ! | - | Jfrog Artifactory API URL. It usually ends with /artifactory |
| cliVersion | String ! | "2.78.0" | Jfrog CLI version |
Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
--access-token env:MYSECRET --url string --cli-version stringfunc (m *MyModule) Example(accessToken *dagger.Secret, url string, cliVersion string) *dagger.Artifactory {
return dag.
Artifactory(accessToken, url, cliVersion)
}@function
def example(access_token: dagger.Secret, url: str, cli_version: str) -> dagger.Artifactory:
return (
dag.artifactory(access_token, url, cli_version)
)@func()
example(accessToken: Secret, url: string, cliVersion: string): Artifactory {
return dag
.artifactory(accessToken, url, cliVersion)
}Types
Artifactory 🔗
upload() 🔗
Upload any file to artifactory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| file | File ! | - | file to upload |
| targetPath | String ! | - | path in artifactory to upload to |
| extraFlags | [String ! ] | - | extra arguments for jf cli |
Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
--access-token env:MYSECRET --url string --cli-version string upload --file file:path --target-path stringfunc (m *MyModule) Example(ctx context.Context, accessToken *dagger.Secret, url string, cliVersion string, file *dagger.File, targetPath string) string {
return dag.
Artifactory(accessToken, url, cliVersion).
Upload(ctx, file, targetPath)
}@function
async def example(access_token: dagger.Secret, url: str, cli_version: str, file: dagger.File, target_path: str) -> str:
return await (
dag.artifactory(access_token, url, cli_version)
.upload(file, target_path)
)@func()
async example(accessToken: Secret, url: string, cliVersion: string, file: File, targetPath: string): Promise<string> {
return dag
.artifactory(accessToken, url, cliVersion)
.upload(file, targetPath)
}createEvidence() 🔗
Upload evidence to a resource in Artifactory
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| predicate | File ! | - | predicate File to attach as evidence |
| predicateType | String ! | - | predicate type based on in-toto attestation predicates |
| key | File ! | - | private key to sign DSSE envelope |
| keyAlias | String | - | key alias for a public key that exists in your Artifactory instance to validate the signature |
| subjectRepoPath | String | - | If the resource is an Artifact, a path to the artifact |
| packageName | String | - | If the resource is a Package, the name of the package |
| packageVersion | String | - | If the resource is a Package, the version of the package |
| packageRepoName | String | - | If the resource is a Package, the name of the package repo |
| buildName | String | - | If the resource is a Build, the name of the build |
| buildNumber | String | - | If the resource is a Build, the number of the build |
| releaseBundleName | String | - | If the resource is a Release Bundle, the name of the release bundle |
| releaseBundleVersion | String | - | If the resource is a Release Bundle, the version of the release bundle |
| extraArgs | [String ! ] | - | extra flags to pass through to jf cli |
| traceUrl | String | - | dagger cloud trace URL to attach to evidence |
Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
--access-token env:MYSECRET --url string --cli-version string create-evidence --predicate file:path --predicate-type string --key file:pathfunc (m *MyModule) Example(ctx context.Context, accessToken *dagger.Secret, url string, cliVersion string, predicate *dagger.File, predicateType string, key *dagger.File) string {
return dag.
Artifactory(accessToken, url, cliVersion).
CreateEvidence(ctx, predicate, predicateType, key)
}@function
async def example(access_token: dagger.Secret, url: str, cli_version: str, predicate: dagger.File, predicate_type: str, key: dagger.File) -> str:
return await (
dag.artifactory(access_token, url, cli_version)
.create_evidence(predicate, predicate_type, key)
)@func()
async example(accessToken: Secret, url: string, cliVersion: string, predicate: File, predicateType: string, key: File): Promise<string> {
return dag
.artifactory(accessToken, url, cliVersion)
.createEvidence(predicate, predicateType, key)
}jfExec() 🔗
Run a command with the jf CLI
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] ! | - | arguments to pass to jf cli |
Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
--access-token env:MYSECRET --url string --cli-version string jf-exec --args string1 --args string2func (m *MyModule) Example(accessToken *dagger.Secret, url string, cliVersion string, args []string) *dagger.Container {
return dag.
Artifactory(accessToken, url, cliVersion).
JfExec(args)
}@function
def example(access_token: dagger.Secret, url: str, cli_version: str, args: List[str]) -> dagger.Container:
return (
dag.artifactory(access_token, url, cli_version)
.jf_exec(args)
)@func()
example(accessToken: Secret, url: string, cliVersion: string, args: string[]): Container {
return dag
.artifactory(accessToken, url, cliVersion)
.jfExec(args)
}cli() 🔗
Get a Container with the jf CLI installed
Return Type
Container ! Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
--access-token env:MYSECRET --url string --cli-version string clifunc (m *MyModule) Example(accessToken *dagger.Secret, url string, cliVersion string) *dagger.Container {
return dag.
Artifactory(accessToken, url, cliVersion).
Cli()
}@function
def example(access_token: dagger.Secret, url: str, cli_version: str) -> dagger.Container:
return (
dag.artifactory(access_token, url, cli_version)
.cli()
)@func()
example(accessToken: Secret, url: string, cliVersion: string): Container {
return dag
.artifactory(accessToken, url, cliVersion)
.cli()
}