This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
dagger/stdlib/gcp/cloudrun/main.cue
Tihomir Jovicic 15792fb924 Move Cloud Run image property to GCP config struct
Signed-off-by: Tihomir Jovicic <tihomir.jovicic.develop@gmail.com>
2021-06-10 11:52:54 +02:00

50 lines
836 B
CUE

package cloudrun
import (
"dagger.io/dagger/op"
"dagger.io/gcp"
)
// Deploy deploys a Cloud Run service based on provided GCR image
#Deploy: {
// GCP Config
config: gcp.#Config
// service name
serviceName: string @dagger(input)
// GCR image ref
image: string @dagger(input)
// Cloud Run platform
platform: *"managed" | string @dagger(input)
#up: [
op.#Load & {
from: gcp.#GCloud & {
"config": config
}
},
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",
"--norc",
"-eo",
"pipefail",
"-c",
#"""
gcloud run deploy "$SERVICE_NAME" --image "$IMAGE" --region "$REGION" --platform "$PLATFORM" --allow-unauthenticated
"""#,
]
env: {
SERVICE_NAME: serviceName
PLATFORM: platform
REGION: config.region
IMAGE: image
}
},
]
}