<commit_before> #!/bin/bash
bold() {
  echo ". $(tput bold)" "$*" "$(tput sgr0)";
}

err() {
  echo "$*" >&2;
}

bold "Set all vars..."
set -a
  source .properties
  set +a

bold "Build container & push to registry"
gcloud builds submit --config _cloudbuilder/setup.yaml

bold "Remove old deployments"
kubectl delete deployment chatserver
kubectl delete deployment web

bold "Eval the templates & deploy the containers..."
# https://stackoverflow.com/questions/23620827/envsubst-command-not-found-on-mac-os-x-10-8
cat _cloudbuilder/chatserver-deployment.yaml | envsubst | kubectl apply -f -
cat _cloudbuilder/web-deployment.yaml | envsubst | kubectl apply -f -

bold "Create services..."
kubectl delete -f _cloudbuilder/services.yaml
kubectl apply -f _cloudbuilder/services.yaml

bold "Create loadbalancer / Ingress..."
kubectl delete -f _cloudbuilder/loadbalancer.yaml
cat _cloudbuilder/loadbalancer.yaml | envsubst | kubectl apply -f -

bold "Deploy Ad website"
cd ads
gcloud builds submit --tag gcr.io/$PROJECT_ID/ads
gcloud run deploy --image gcr.io/$PROJECT_ID/ads<commit_msg>push ads<commit_after> #!/bin/bash
bold() {
  echo ". $(tput bold)" "$*" "$(tput sgr0)";
}

err() {
  echo "$*" >&2;
}

bold "Set all vars..."
set -a
  source .properties
  set +a

bold "Renew config maps"
kubectl remove configmap chatserver-config
kubectl create configmap chatserver-config --from-env-file=backend/.env

bold "Build container & push to registry"
gcloud builds submit --config _cloudbuilder/setup.yaml

bold "Remove old deployments"
kubectl delete deployment chatserver
kubectl delete deployment web

bold "Eval the templates & deploy the containers..."
# https://stackoverflow.com/questions/23620827/envsubst-command-not-found-on-mac-os-x-10-8
cat _cloudbuilder/chatserver-deployment.yaml | envsubst | kubectl apply -f -
cat _cloudbuilder/web-deployment.yaml | envsubst | kubectl apply -f -

bold "Create services..."
kubectl delete -f _cloudbuilder/services.yaml
kubectl apply -f _cloudbuilder/services.yaml

bold "Create loadbalancer / Ingress..."
kubectl delete -f _cloudbuilder/loadbalancer.yaml
cat _cloudbuilder/loadbalancer.yaml | envsubst | kubectl apply -f -

bold "Deploy Ad website"
cd ads
gcloud builds submit --tag gcr.io/$PROJECT_ID/ads
gcloud run deploy ads --platform=managed --allow-unauthenticated --region $REGION_ALTERNATIVE --image gcr.io/$PROJECT_ID/ads
{'fraction_non_alphanumeric': 0.11962931760741365, 'fraction_numerical': 0.010951979780960405, 'mean_word_length': 4.208333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3035496', 'n_tokens_mistral': 811, 'n_tokens_neox': 799, 'n_words': 228}