Skip to content

Commit

Permalink
Use deployment functions curled from k8s-install repo
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Jun 13, 2020
1 parent 2847a03 commit 7d98d12
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions .circleci/deploy_to_namespace.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
#!/bin/bash -Eeu

source <(curl https://raw.githubusercontent.com/cyber-dojo/k8s-install/master/sh/helm_upgrade_probe_yes_prometheus_yes.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 NAMESPACE="${1}" # beta|prod
readonly K8S_URL=https://raw.githubusercontent.com/cyber-dojo/k8s-install/master
readonly VERSIONER_URL=https://raw.githubusercontent.com/cyber-dojo/versioner/master
source <(curl "${K8S_URL}/sh/deployment_functions.sh")
export $(curl "${VERSIONER_URL}/app/.env")
readonly CYBER_DOJO_AVATARS_TAG="${CIRCLE_SHA1:0:7}"

gcloud_init
helm_init
helm_upgrade_probe_yes_prometheus_yes \
"${NAMESPACE}" "avatars" \
"${NAMESPACE}" \
"avatars" \
"${CYBER_DOJO_AVATARS_IMAGE}" \
"${CYBER_DOJO_AVATARS_TAG}" \
"${CYBER_DOJO_AVATARS_PORT}" \
Expand Down

0 comments on commit 7d98d12

Please sign in to comment.