Dagger
Search

gcp

This module lets you push a container into Google Artifact Registry, automating the tedious manual steps of setting up a service account for the docker credential

Installation

dagger install github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396

Entrypoint

Return Type
Gcp
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
func (m *myModule) example() *Gcp  {
	return dag.
			Gcp()
}
@function
def example() -> dag.Gcp:
	return (
		dag.gcp()
	)
@func()
example(): Gcp {
	return dag
		.gcp()
}

Types

Gcp 🔗

getSecret() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 get-secret --gcp-credentials file:path
func (m *myModule) example(ctx context.Context, gcpCredentials *File) string  {
	return dag.
			Gcp().
			GetSecret(ctx, gcpCredentials)
}
@function
async def example(gcp_credentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.get_secret(gcp_credentials)
	)
@func()
async example(gcpCredentials: File): Promise<string> {
	return dag
		.gcp()
		.getSecret(gcpCredentials)
}

withGcpSecret() 🔗

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 with-gcp-secret --ctr IMAGE:TAG --gcp-credentials file:path
func (m *myModule) example(ctr *Container, gcpCredentials *File) *Container  {
	return dag.
			Gcp().
			WithGcpSecret(ctr, gcpCredentials)
}
@function
def example(ctr: dagger.Container, gcp_credentials: dagger.File) -> dagger.Container:
	return (
		dag.gcp()
		.with_gcp_secret(ctr, gcp_credentials)
	)
@func()
example(ctr: Container, gcpCredentials: File): Container {
	return dag
		.gcp()
		.withGcpSecret(ctr, gcpCredentials)
}

gcloudCli() 🔗

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
projectString !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 gcloud-cli --project string --gcp-credentials file:path
func (m *myModule) example(project string, gcpCredentials *File) *Container  {
	return dag.
			Gcp().
			GcloudCli(project, gcpCredentials)
}
@function
def example(project: str, gcp_credentials: dagger.File) -> dagger.Container:
	return (
		dag.gcp()
		.gcloud_cli(project, gcp_credentials)
	)
@func()
example(project: string, gcpCredentials: File): Container {
	return dag
		.gcp()
		.gcloudCli(project, gcpCredentials)
}

list() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
accountString !-No description provided
projectString !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 list --account string --project string --gcp-credentials file:path
func (m *myModule) example(ctx context.Context, account string, project string, gcpCredentials *File) string  {
	return dag.
			Gcp().
			List(ctx, account, project, gcpCredentials)
}
@function
async def example(account: str, project: str, gcp_credentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.list(account, project, gcp_credentials)
	)
@func()
async example(account: string, project: string, gcpCredentials: File): Promise<string> {
	return dag
		.gcp()
		.list(account, project, gcpCredentials)
}

garEnsureServiceAccountKey() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
accountString !-No description provided
regionString !-No description provided
projectString !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 gar-ensure-service-account-key --account string --region string --project string --gcp-credentials file:path
func (m *myModule) example(ctx context.Context, account string, region string, project string, gcpCredentials *File) string  {
	return dag.
			Gcp().
			GarEnsureServiceAccountKey(ctx, account, region, project, gcpCredentials)
}
@function
async def example(account: str, region: str, project: str, gcp_credentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.gar_ensure_service_account_key(account, region, project, gcp_credentials)
	)
@func()
async example(account: string, region: string, project: string, gcpCredentials: File): Promise<string> {
	return dag
		.gcp()
		.garEnsureServiceAccountKey(account, region, project, gcpCredentials)
}

garPushExample() 🔗

Push ubuntu:latest to GAR under existing repo

Return Type
String !
Arguments
NameTypeDefault ValueDescription
accountString !-No description provided
regionString !-No description provided
projectString !-No description provided
repoString !-No description provided
imageString !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 gar-push-example --account string --region string --project string --repo string --image string --gcp-credentials file:path
func (m *myModule) example(ctx context.Context, account string, region string, project string, repo string, image string, gcpCredentials *File) string  {
	return dag.
			Gcp().
			GarPushExample(ctx, account, region, project, repo, image, gcpCredentials)
}
@function
async def example(account: str, region: str, project: str, repo: str, image: str, gcp_credentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.gar_push_example(account, region, project, repo, image, gcp_credentials)
	)
@func()
async example(account: string, region: string, project: string, repo: string, image: string, gcpCredentials: File): Promise<string> {
	return dag
		.gcp()
		.garPushExample(account, region, project, repo, image, gcpCredentials)
}

cleanupServiceAccountKey() 🔗

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
accountString !-No description provided
regionString !-No description provided
projectString !-No description provided
gcpCredentialsFile !-No description provided
keyIdString !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 cleanup-service-account-key --account string --region string --project string --gcp-credentials file:path --key-id string
func (m *myModule) example(ctx context.Context, account string, region string, project string, gcpCredentials *File, keyId string)   {
	return dag.
			Gcp().
			CleanupServiceAccountKey(ctx, account, region, project, gcpCredentials, keyId)
}
@function
async def example(account: str, region: str, project: str, gcp_credentials: dagger.File, key_id: str) -> None:
	return await (
		dag.gcp()
		.cleanup_service_account_key(account, region, project, gcp_credentials, key_id)
	)
@func()
async example(account: string, region: string, project: string, gcpCredentials: File, keyId: string): Promise<void> {
	return dag
		.gcp()
		.cleanupServiceAccountKey(account, region, project, gcpCredentials, keyId)
}

garPush() 🔗

Return Type
String !
Arguments
NameTypeDefault ValueDescription
pushCtrContainer !-No description provided
accountString !-No description provided
regionString !-No description provided
projectString !-No description provided
repoString !-No description provided
imageString !-No description provided
gcpCredentialsFile !-No description provided
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@a82d367c658858490512515eb99d0288bcae1396 call \
 gar-push --push-ctr IMAGE:TAG --account string --region string --project string --repo string --image string --gcp-credentials file:path
func (m *myModule) example(ctx context.Context, pushCtr *Container, account string, region string, project string, repo string, image string, gcpCredentials *File) string  {
	return dag.
			Gcp().
			GarPush(ctx, pushCtr, account, region, project, repo, image, gcpCredentials)
}
@function
async def example(push_ctr: dagger.Container, account: str, region: str, project: str, repo: str, image: str, gcp_credentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.gar_push(push_ctr, account, region, project, repo, image, gcp_credentials)
	)
@func()
async example(pushCtr: Container, account: string, region: string, project: string, repo: string, image: string, gcpCredentials: File): Promise<string> {
	return dag
		.gcp()
		.garPush(pushCtr, account, region, project, repo, image, gcpCredentials)
}