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.0Entrypoint
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
| Name | Type | Default Value | Description |
|---|---|---|---|
| gcloud | Container ! | - | Authenticated gcloud container |
| repository | String ! | - | Repository name to create |
| region | String ! | "us-central1" | GCP region |
| format | String ! | "docker" | Repository format: docker or generic |
| description | String ! | "" | 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 stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| projectId | String ! | - | GCP project ID |
| repository | String ! | - | Repository name |
| imageName | String ! | - | Image name |
| region | String ! | "us-central1" | GCP region |
| tag | String ! | "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 stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| gcloud | Container ! | - | Authenticated gcloud container |
| projectId | String ! | - | GCP project ID |
| repository | String ! | - | Repository name |
| region | String ! | "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 stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | Container to publish |
| projectId | String ! | - | GCP project ID |
| repository | String ! | - | Artifact Registry repository name |
| imageName | String ! | - | Image name |
| region | String ! | "us-central1" | GCP region |
| tag | String ! | "latest" | Image tag |
| gcloud | Container | null | Authenticated gcloud container |
| dockerConfig | File | null | Docker 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 stringfunc (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
| Name | Type | Default Value | Description |
|---|---|---|---|
| gcloud | Container ! | - | Authenticated gcloud container |
| directory | Directory ! | - | Directory containing files to upload |
| projectId | String ! | - | GCP project ID |
| repository | String ! | - | Generic repository name |
| packageName | String ! | - | Package name |
| version | String ! | - | Package version |
| region | String ! | "us-central1" | GCP region |
| filePattern | String ! | "*" | 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 stringfunc (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)
}