Created
February 28, 2024 18:24
-
-
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
This file contains hidden or 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 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