<commit_before>#!/bin/bash -Eeu

source ./.circleci/helm_upgrade.sh

# misc env-vars are in ci context

echo ${GCP_K8S_CREDENTIALS} > /gcp/gcp-credentials.json

gcloud auth activate-service-account \
  "${SERVICE_ACCOUNT}" \
  --key-file=/gcp/gcp-credentials.json

gcloud container clusters get-credentials \
  "${CLUSTER}" \
  --zone "${ZONE}" \
  --project "${PROJECT}"

helm init --client-only

helm repo add praqma https://praqma-helm-repo.s3.amazonaws.com/

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Normally I export the cyberdojo env-vars using the command
# $ docker run --rm cyberdojo/versioner:latest
# This won't work on the .circleci deployment step since it is
# run inside the cyberdojo/gcloud-kubectl-helm image which does
# not have docker. So doing it directly from versioner's git repo
export $(curl https://raw.githubusercontent.com/cyber-dojo/versioner/master/app/.env)

readonly NAMESPACE="${1}" # beta|prod
readonly CYBER_DOJO_WEB_TAG="${CIRCLE_SHA1:0:7}"

helm_upgrade \
   "${NAMESPACE}" "web" "praqma/cyber-dojo-service --version 0.2.5" \
   "${CYBER_DOJO_WEB_IMAGE}" \
   "${CYBER_DOJO_WEB_TAG}" \
   "${CYBER_DOJO_WEB_PORT}" \
   ".circleci/k8s-general-values.yml"<commit_msg>In k8s deployment, use helm_upgrade() function from new k8s-install repo.<commit_after>#!/bin/bash -Eeu

source <(curl https://raw.githubusercontent.com/cyber-dojo/k8s-install/master/sh/helm_upgrade_probe_no_prometheus_no.sh)

# misc env-vars are in ci context

echo ${GCP_K8S_CREDENTIALS} > /gcp/gcp-credentials.json

gcloud auth activate-service-account \
  "${SERVICE_ACCOUNT}" \
  --key-file=/gcp/gcp-credentials.json

gcloud container clusters get-credentials \
  "${CLUSTER}" \
  --zone "${ZONE}" \
  --project "${PROJECT}"

helm init --client-only

helm repo add praqma https://praqma-helm-repo.s3.amazonaws.com/

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Normally I export the cyberdojo env-vars using the command
# $ docker run --rm cyberdojo/versioner:latest
# This won't work on the .circleci deployment step since it is
# run inside the cyberdojo/gcloud-kubectl-helm image which does
# not have docker. So doing it directly from versioner's git repo
export $(curl https://raw.githubusercontent.com/cyber-dojo/versioner/master/app/.env)

readonly NAMESPACE="${1}" # beta|prod
readonly CYBER_DOJO_WEB_TAG="${CIRCLE_SHA1:0:7}"

helm_upgrade_probe_no_prometheus_no \
   "${NAMESPACE}" "web" \
   "${CYBER_DOJO_WEB_IMAGE}" \
   "${CYBER_DOJO_WEB_TAG}" \
   "${CYBER_DOJO_WEB_PORT}" \
   ".circleci/k8s-general-values.yml"
{'fraction_non_alphanumeric': 0.1559704395176974, 'fraction_numerical': 0.007779074290159471, 'mean_word_length': 3.404109589041096, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2340522', 'n_tokens_mistral': 988, 'n_tokens_neox': 969, 'n_words': 196}