00f7e63c4a
Signed-off-by: Guillaume de Rouville <guillaume.derouville@gmail.com>
42 lines
644 B
CUE
42 lines
644 B
CUE
package gcpcloudrun
|
|
|
|
import (
|
|
"alpha.dagger.io/dagger"
|
|
"alpha.dagger.io/docker"
|
|
"alpha.dagger.io/gcp"
|
|
"alpha.dagger.io/gcp/cloudrun"
|
|
"alpha.dagger.io/gcp/gcr"
|
|
)
|
|
|
|
#Run: {
|
|
// Source code of the sample application
|
|
src: dagger.#Artifact & dagger.#Input
|
|
|
|
// GCR full image name
|
|
imageRef: string & dagger.#Input
|
|
|
|
image: docker.#Build & {
|
|
source: src
|
|
}
|
|
|
|
gcpConfig: gcp.#Config
|
|
|
|
creds: gcr.#Credentials & {
|
|
config: gcpConfig
|
|
}
|
|
|
|
push: docker.#Push & {
|
|
target: imageRef
|
|
source: image
|
|
auth: {
|
|
username: creds.username
|
|
secret: creds.secret
|
|
}
|
|
}
|
|
|
|
deploy: cloudrun.#Service & {
|
|
config: gcpConfig
|
|
image: push.ref
|
|
}
|
|
}
|