Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.
/ gcloud-v1 Public archive
Notifications You must be signed in to change notification settings

Zero65Tech/gcloud-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloud Run (gcloud)

  • Receives http post requests from GitHub on a webhook.
  • Creates a build on Cloud Build for each request.

Cloud Build

  • Uses SSH_KEY stored with Security / Secret Manager to pull repositories from GitHub.
  • Uses Dockerfile to build a docker image.
  • Pushes the docker image to Artifacts Registry.
  • Deploys a new Cloud Run (same-as-repo-name) version with the docker image.

Script to clean-up Google Cloud Contain Registry

PROJECT="zero65"
REGISTRY="gcloud"

while true; do
  echo "\n"
  DIGEST=$(gcloud container images list-tags gcr.io/$PROJECT/$REGISTRY --format="get(digest)" --limit 1)
  if [ "$DIGEST" = "" ]; then
    break;
  fi  
  gcloud container images delete gcr.io/$PROJECT/$REGISTRY@$DIGEST --force-delete-tags --quiet
done

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks