Created
November 19, 2019 22:58
-
-
Save grant/de2acedd094ec676d2d2822b3d350bae to your computer and use it in GitHub Desktop.
YouTube API on Cloud Run – Deploy Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# Set env var "GCP_PROJECT" to our project name | |
GCP_PROJECT=$(gcloud config list --format 'value(core.project)' 2>/dev/null) | |
# Set our Cloud Run region (so we aren't prompted) | |
gcloud config set run/region us-central1 | |
# Build and upload your image in Google Container Registry | |
gcloud builds submit --tag gcr.io/$GCP_PROJECT/yt | |
# Deploy your container to Cloud Run | |
ENV=$(cat .env) | |
gcloud run deploy --image gcr.io/$GCP_PROJECT/yt --platform managed --set-env-vars=$ENV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment