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@24542b29f993189f99692736ed827db483b374e1

Entrypoint

Return Type
Gcp
Example
dagger -m github.com/vikram-dagger/gcp-for-dagger@24542b29f993189f99692736ed827db483b374e1 call \
func (m *MyModule) Example() *dagger.Gcp  {
	return dag.
			Gcp()
}
@function
def example() -> dagger.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@24542b29f993189f99692736ed827db483b374e1 call \
 get-secret --gcp-credentials file:path
func (m *MyModule) Example(ctx context.Context, gcpCredentials *dagger.File) string  {
	return dag.
			Gcp().
			Getsecret(ctx, gcpCredentials)
}
@function
async def example(gcpcredentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.getsecret(gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 call \
 with-gcp-secret --ctr IMAGE:TAG --gcp-credentials file:path
func (m *MyModule) Example(ctr *dagger.Container, gcpCredentials *dagger.File) *dagger.Container  {
	return dag.
			Gcp().
			Withgcpsecret(ctr, gcpCredentials)
}
@function
def example(ctr: dagger.Container, gcpcredentials: dagger.File) -> dagger.Container:
	return (
		dag.gcp()
		.withgcpsecret(ctr, gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 call \
 gcloud-cli --project string --gcp-credentials file:path
func (m *MyModule) Example(project string, gcpCredentials *dagger.File) *dagger.Container  {
	return dag.
			Gcp().
			Gcloudcli(project, gcpCredentials)
}
@function
def example(project: str, gcpcredentials: dagger.File) -> dagger.Container:
	return (
		dag.gcp()
		.gcloudcli(project, gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 call \
 list --account string --project string --gcp-credentials file:path
func (m *MyModule) Example(ctx context.Context, account string, project string, gcpCredentials *dagger.File) string  {
	return dag.
			Gcp().
			List(ctx, account, project, gcpCredentials)
}
@function
async def example(account: str, project: str, gcpcredentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.list(account, project, gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 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 *dagger.File) string  {
	return dag.
			Gcp().
			Garensureserviceaccountkey(ctx, account, region, project, gcpCredentials)
}
@function
async def example(account: str, region: str, project: str, gcpcredentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.garensureserviceaccountkey(account, region, project, gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 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 *dagger.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, gcpcredentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.garpushexample(account, region, project, repo, image, gcpcredentials)
	)
@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@24542b29f993189f99692736ed827db483b374e1 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 *dagger.File, keyId string)   {
	return dag.
			Gcp().
			Cleanupserviceaccountkey(ctx, account, region, project, gcpCredentials, keyId)
}
@function
async def example(account: str, region: str, project: str, gcpcredentials: dagger.File, keyid: str) -> None:
	return await (
		dag.gcp()
		.cleanupserviceaccountkey(account, region, project, gcpcredentials, keyid)
	)
@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@24542b29f993189f99692736ed827db483b374e1 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 *dagger.Container, account string, region string, project string, repo string, image string, gcpCredentials *dagger.File) string  {
	return dag.
			Gcp().
			Garpush(ctx, pushCtr, account, region, project, repo, image, gcpCredentials)
}
@function
async def example(pushctr: dagger.Container, account: str, region: str, project: str, repo: str, image: str, gcpcredentials: dagger.File) -> str:
	return await (
		dag.gcp()
		.garpush(pushctr, account, region, project, repo, image, gcpcredentials)
	)
@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)
}