This a Cloud Run example including Cloud Build. It accompanies my blog post.
gcloud auth login
# WARNING: This takes the first billing account from your list. Change accordingly in the script if needed.
./setup.sh ${PROJECT_ID}
gcloud builds submit --config cloudbuild.yaml .
If you want to pull the image locally:
gcloud auth configure-docker
docker pull gcr.io/${PROJECT_ID}/pdfdist
We enabled security scanning by adding the GCP API containerscanning.googleapis.com
during setup. To check for issues:
gcloud beta container images list-tags --show-occurrences gcr.io/${PROJECT_ID}/pdfdist
gcloud beta container images describe gcr.io/${PROJECT_ID}/pdfdist@sha256:<image_hash>
export YOUR_DOMAIN=<choose>
gcloud domains verify ${YOUR_DOMAIN}
gcloud beta run domain-mappings create --service pdfdist --domain pdfdist.${YOUR_DOMAIN} --platform managed --region us-central1
# Check when it's up
gcloud beta run domain-mappings describe --domain pdfdist.${YOUR_DOMAIN} --platform managed --region us-central1
Via CLI, it didn't work at the time of writing - follow this issue. Some day, it might work like this:
gcloud alpha builds triggers create github --repo_name=github_${OWNER_NAME}_${REPO_NAME} --repo_owner=${OWNER_NAME} --branch_pattern=^master$ --build_config=cloudbuild.yaml
You can do it via the UI though, as described in the Cloud Run tutorial.