gcloud builds submit --tag gcr.io/dcdingprject/hello-bang .
gcloud run deploy hw-cloudrun --image gcr.io/dcdingprject/hello-bang:latest --region asia-southeast2 --allow-unauthenticated
gcloud run services replace service.yaml
gcloud iam service-accounts add-iam-policy-binding \
[email protected] \
--member="serviceAccount:[email protected]" \
--role="roles/iam.serviceAccountUser"
steps:
# Build the container image
- name: "gcr.io/cloud-builders/docker"
args: ["build", "-t", "gcr.io/PROJECT_ID/IMAGE", "."]
# Push the container image to Container Registry
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/PROJECT_ID/IMAGE"]
# Deploy container image to Cloud Run
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: gcloud
args:
["run", "deploy", "SERVICE-NAME", "--image", "gcr.io/PROJECT_ID/IMAGE", "--region", "REGION"]
images:
- gcr.io/PROJECT_ID/IMAGE