Dagger
Search

artifactory

This module provides functions for uploading build artifacts and related files to your Artifactory instance

Installation

dagger install github.com/kpenfound/dag/artifactory@v1.0.1

Entrypoint

Return Type
Artifactory !
Arguments
NameTypeDefault ValueDescription
accessTokenSecret !-Artifactory access token
urlString !-Jfrog Artifactory API URL. It usually ends with /artifactory
cliVersionString !"2.78.0"Jfrog CLI version
Example
dagger -m github.com/kpenfound/dag/artifactory@c62d161021b4c596f8a2d6a05df15045c24f77ac call \
 --access-token env:MYSECRET --url string --cli-version string
func (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
NameTypeDefault ValueDescription
fileFile !-file to upload
targetPathString !-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 string
func (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
NameTypeDefault ValueDescription
predicateFile !-predicate File to attach as evidence
predicateTypeString !-predicate type based on in-toto attestation predicates
keyFile !-private key to sign DSSE envelope
keyAliasString -key alias for a public key that exists in your Artifactory instance to validate the signature
subjectRepoPathString -If the resource is an Artifact, a path to the artifact
packageNameString -If the resource is a Package, the name of the package
packageVersionString -If the resource is a Package, the version of the package
packageRepoNameString -If the resource is a Package, the name of the package repo
buildNameString -If the resource is a Build, the name of the build
buildNumberString -If the resource is a Build, the number of the build
releaseBundleNameString -If the resource is a Release Bundle, the name of the release bundle
releaseBundleVersionString -If the resource is a Release Bundle, the version of the release bundle
extraArgs[String ! ] -extra flags to pass through to jf cli
traceUrlString -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:path
func (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
NameTypeDefault ValueDescription
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 string2
func (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 cli
func (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()
}