Dagger
Search

google-cloud-run

This module provides functions to create or update a Google Cloud Run service using a container image.

It requires a Google Cloud service account with Editor, Service Account Token Creator, Cloud Run Admin roles.

Installation

dagger install github.com/vvaswani/daggerverse/google-cloud-run@v0.1.5

Entrypoint

Return Type
GoogleCloudRun
Example
func (m *myModule) example() *GoogleCloudRun  {
	return dag.
			GoogleCloudRun()
}
@function
def example() -> dag.GoogleCloudRun:
	return (
		dag.google_cloud_run()
	)
@func()
example(): GoogleCloudRun {
	return dag
		.googleCloudRun()
}

Types

GoogleCloudRun

createService()

Deploys an image to Google Cloud Run and returns a string representing the URL of the new service

example: dagger call create-service –project myproject –location us-central1 –image docker.io/nginx –http-port 80 –credential env:GOOGLE_CREDENTIAL

Return Type
String !
Arguments
NameTypeDefault ValueDescription
projectString !-No description provided
locationString !-No description provided
imageString !-No description provided
httpPortInteger !-No description provided
credentialSecret !-No description provided
Example
dagger -m github.com/vvaswani/daggerverse/google-cloud-run@6e44ee4a901dda7d742574354132745701db3c52 call \
 create-service --project string --location string --image string --http-port integer --credential env:MYSECRET
func (m *myModule) example(ctx context.Context, project string, location string, image string, httpPort int, credential *Secret) string  {
	return dag.
			GoogleCloudRun().
			CreateService(ctx, project, location, image, httpPort, credential)
}
@function
async def example(project: str, location: str, image: str, http_port: int, credential: dagger.Secret) -> str:
	return await (
		dag.google_cloud_run()
		.create_service(project, location, image, http_port, credential)
	)
@func()
async example(project: string, location: string, image: string, httpPort: number, credential: Secret): Promise<string> {
	return dag
		.googleCloudRun()
		.createService(project, location, image, httpPort, credential)
}

updateService()

Deploys an image to an existing Google Cloud Run service and returns a string representing the URL of the updated service

example: dagger call update-service –project myproject –location us-central1 –service myservice –image docker.io/nginx –http-port 80 –credential env:GOOGLE_CREDENTIAL

Return Type
String !
Arguments
NameTypeDefault ValueDescription
projectString !-No description provided
locationString !-No description provided
serviceString !-No description provided
imageString !-No description provided
httpPortInteger !-No description provided
credentialSecret !-No description provided
Example
dagger -m github.com/vvaswani/daggerverse/google-cloud-run@6e44ee4a901dda7d742574354132745701db3c52 call \
 update-service --project string --location string --service string --image string --http-port integer --credential env:MYSECRET
func (m *myModule) example(ctx context.Context, project string, location string, service string, image string, httpPort int, credential *Secret) string  {
	return dag.
			GoogleCloudRun().
			UpdateService(ctx, project, location, service, image, httpPort, credential)
}
@function
async def example(project: str, location: str, service: str, image: str, http_port: int, credential: dagger.Secret) -> str:
	return await (
		dag.google_cloud_run()
		.update_service(project, location, service, image, http_port, credential)
	)
@func()
async example(project: string, location: string, service: string, image: string, httpPort: number, credential: Secret): Promise<string> {
	return dag
		.googleCloudRun()
		.updateService(project, location, service, image, httpPort, credential)
}