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
## Requires these variables to be set | |
# export PROJECT=your-projectname | |
# export DNS_ZONE=your.domain.com. | |
[[ -z “$PROJECT” ]] && { echo “Env var PROJECT is missing, please export PROJECT=your-project” ; exit 1; } | |
[[ -z “$DNS_ZONE” ]] && { echo “Env var DNS_ZONE is missing, please export DNS_ZONE=your.domain.com.” ; exit 1; } | |
# Create Clusters | |
gcloud container clusters create west-cluster — zone us-west1-a — scopes “cloud-platform,storage-ro,logging-write,monitoring-write,service-control,service-management,https://www.googleapis.com/auth/ndev.clouddns.readwrite" | |
gcloud container clusters create east-cluster — zone us-east1-b — scopes “cloud-platform,storage-ro,logging-write,monitoring-write,service-control,service-management,https://www.googleapis.com/auth/ndev.clouddns.readwrite" | |
# Make Aliases | |
kubectl config set-context east — cluster=gke_${PROJECT}_us-east1-b_east-cluster — user=gke_${PROJECT}_us-east1-b_east-cluster |
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 | |
VERSIONS=$(gcloud app versions list --service $1 --sort-by '~version' --format 'value(version.id)') | |
COUNT=0 | |
echo "Keeping the $2 latest versions of the $1 service" | |
for VERSION in $VERSIONS | |
do | |
((COUNT++)) | |
if [ $COUNT -gt $2 ] | |
then |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"os" | |
"cloud.google.com/go/bigquery" | |
) |
OlderNewer