Skip to content

Instantly share code, notes, and snippets.

@Intelrunner
Created February 28, 2024 18:24
Show Gist options
  • Save Intelrunner/e735ea89eb0f1f81b0139fc984be673b to your computer and use it in GitHub Desktop.
Save Intelrunner/e735ea89eb0f1f81b0139fc984be673b to your computer and use it in GitHub Desktop.
Lists the current Docker REgistry being used to deploy all Google Cloud functions in a project
#!/bin/bash
# Set your GCP project ID
PROJECT_ID=$(gcloud config get-value project)
# List all functions in the project and iterate over them
for FUNCTION_NAME in $(gcloud functions list --project=$PROJECT_ID --format="value(name)")
do
echo "Function: $FUNCTION_NAME"
# Describe each function to get the dockerRegistry value
DOCKER_REGISTRY=$(gcloud functions describe $FUNCTION_NAME --format="value(buildConfig.dockerRegistry)" --project=$PROJECT_ID)
echo "Docker Registry: $DOCKER_REGISTRY"
echo "---------------------------------"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment