Skip to content

Instantly share code, notes, and snippets.

@Geremie
Last active April 13, 2022 18:43
Show Gist options
  • Save Geremie/09cb9c8d688f7cf6cb8815b1b589dc3b to your computer and use it in GitHub Desktop.
Save Geremie/09cb9c8d688f7cf6cb8815b1b589dc3b to your computer and use it in GitHub Desktop.
Manage your Private Python Packages with Artifact Registry (Part 1)
# Clone the cloud function repository
git clone https://gitlab.com/marcdjoh/cloud-functions-pull-from-artifact-registry.git
# Activate the cloud functions API
gcloud services enable cloudfunctions.googleapis.com
# Activate the cloud build API
gcloud services enable cloudbuild.googleapis.com
# Create a service account for the fucntion
gcloud iam service-accounts create <your_service_account_id>
# Deploy the cloud function
gcloud functions deploy <your_function_name> --runtime=python37 --entry-point=main \
--trigger-http \
--region=<your_function_location> \
--service-account=<your_service_account_id>@<your_gcp_project>.iam.gserviceaccount.com \
--allow-unauthenticated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment