Dagger
Search

gcp-artifact-registry

Provides functions for authenticating with Artifact Registry, publishing container images,
and managing repository access in Dagger pipelines.

Installation

dagger install github.com/telchak/daggerverse/gcp-artifact-registry@v0.1.0

Entrypoint

Return Type
GcpArtifactRegistry !
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
func (m *MyModule) Example() *dagger.GcpArtifactRegistry  {
	return dag.
			GcpArtifactRegistry()
}
@function
def example() -> dagger.GcpArtifactRegistry:
	return (
		dag.gcp_artifact_registry()
	)
@func()
example(): GcpArtifactRegistry {
	return dag
		.gcpArtifactRegistry()
}

Types

GcpArtifactRegistry 🔗

Google Cloud Artifact Registry utilities.

createRepository() 🔗

Create an Artifact Registry repository.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
gcloudContainer !-Authenticated gcloud container
repositoryString !-Repository name to create
regionString !"us-central1"GCP region
formatString !"docker"Repository format: docker or generic
descriptionString !""Repository description
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
 create-repository --gcloud IMAGE:TAG --repository string --region string --format string --description string
func (m *MyModule) Example(ctx context.Context, gcloud *dagger.Container, repository string, region string, format string, description string) string  {
	return dag.
			GcpArtifactRegistry().
			CreateRepository(ctx, gcloud, repository, region, format, description)
}
@function
async def example(gcloud: dagger.Container, repository: str, region: str, format: str, description: str) -> str:
	return await (
		dag.gcp_artifact_registry()
		.create_repository(gcloud, repository, region, format, description)
	)
@func()
async example(gcloud: Container, repository: string, region: string, format: string, description: string): Promise<string> {
	return dag
		.gcpArtifactRegistry()
		.createRepository(gcloud, repository, region, format, description)
}

getImageUri() 🔗

Construct full Artifact Registry image URI.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
projectIdString !-GCP project ID
repositoryString !-Repository name
imageNameString !-Image name
regionString !"us-central1"GCP region
tagString !"latest"Image tag
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
 get-image-uri --project-id string --repository string --image-name string --region string --tag string
func (m *MyModule) Example(ctx context.Context, projectId string, repository string, imageName string, region string, tag string) string  {
	return dag.
			GcpArtifactRegistry().
			GetImageUri(ctx, projectId, repository, imageName, region, tag)
}
@function
async def example(project_id: str, repository: str, image_name: str, region: str, tag: str) -> str:
	return await (
		dag.gcp_artifact_registry()
		.get_image_uri(project_id, repository, image_name, region, tag)
	)
@func()
async example(projectId: string, repository: string, imageName: string, region: string, tag: string): Promise<string> {
	return dag
		.gcpArtifactRegistry()
		.getImageUri(projectId, repository, imageName, region, tag)
}

listImages() 🔗

List images in an Artifact Registry repository.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
gcloudContainer !-Authenticated gcloud container
projectIdString !-GCP project ID
repositoryString !-Repository name
regionString !"us-central1"GCP region
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
 list-images --gcloud IMAGE:TAG --project-id string --repository string --region string
func (m *MyModule) Example(ctx context.Context, gcloud *dagger.Container, projectId string, repository string, region string) string  {
	return dag.
			GcpArtifactRegistry().
			ListImages(ctx, gcloud, projectId, repository, region)
}
@function
async def example(gcloud: dagger.Container, project_id: str, repository: str, region: str) -> str:
	return await (
		dag.gcp_artifact_registry()
		.list_images(gcloud, project_id, repository, region)
	)
@func()
async example(gcloud: Container, projectId: string, repository: string, region: string): Promise<string> {
	return dag
		.gcpArtifactRegistry()
		.listImages(gcloud, projectId, repository, region)
}

publish() 🔗

Publish container to GCP Artifact Registry and return image URI.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
containerContainer !-Container to publish
projectIdString !-GCP project ID
repositoryString !-Artifact Registry repository name
imageNameString !-Image name
regionString !"us-central1"GCP region
tagString !"latest"Image tag
gcloudContainer nullAuthenticated gcloud container
dockerConfigFile nullDocker config.json file with registry credentials (e.g. from ~/.docker/config.json)
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
 publish --container IMAGE:TAG --project-id string --repository string --image-name string --region string --tag string
func (m *MyModule) Example(ctx context.Context, container *dagger.Container, projectId string, repository string, imageName string, region string, tag string) string  {
	return dag.
			GcpArtifactRegistry().
			Publish(ctx, container, projectId, repository, imageName, region, tag)
}
@function
async def example(container: dagger.Container, project_id: str, repository: str, image_name: str, region: str, tag: str) -> str:
	return await (
		dag.gcp_artifact_registry()
		.publish(container, project_id, repository, image_name, region, tag)
	)
@func()
async example(container: Container, projectId: string, repository: string, imageName: string, region: string, tag: string): Promise<string> {
	return dag
		.gcpArtifactRegistry()
		.publish(container, projectId, repository, imageName, region, tag)
}

uploadGeneric() 🔗

Upload files to a generic Artifact Registry repository.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
gcloudContainer !-Authenticated gcloud container
directoryDirectory !-Directory containing files to upload
projectIdString !-GCP project ID
repositoryString !-Generic repository name
packageNameString !-Package name
versionString !-Package version
regionString !"us-central1"GCP region
filePatternString !"*"Glob pattern for files
Example
dagger -m github.com/telchak/daggerverse/gcp-artifact-registry@010621c997378db92da5969584001be575c5e5a7 call \
 upload-generic --gcloud IMAGE:TAG --directory DIR_PATH --project-id string --repository string --package-name string --version string --region string --file-pattern string
func (m *MyModule) Example(ctx context.Context, gcloud *dagger.Container, directory *dagger.Directory, projectId string, repository string, packageName string, version string, region string, filePattern string) string  {
	return dag.
			GcpArtifactRegistry().
			UploadGeneric(ctx, gcloud, directory, projectId, repository, packageName, version, region, filePattern)
}
@function
async def example(gcloud: dagger.Container, directory: dagger.Directory, project_id: str, repository: str, package_name: str, version: str, region: str, file_pattern: str) -> str:
	return await (
		dag.gcp_artifact_registry()
		.upload_generic(gcloud, directory, project_id, repository, package_name, version, region, file_pattern)
	)
@func()
async example(gcloud: Container, directory: Directory, projectId: string, repository: string, packageName: string, version: string, region: string, filePattern: string): Promise<string> {
	return dag
		.gcpArtifactRegistry()
		.uploadGeneric(gcloud, directory, projectId, repository, packageName, version, region, filePattern)
}