Skip to content
Snippets Groups Projects
run_basic_grb_test.sh 883 B
Newer Older
#!/usr/bin/env bash

debug() {
    >&2 echo "DEBUG: $@"
}

error() {
    >&2 echo "ERROR: $@"
    exit 1
}

set -e

ns=$(./helpers/get_namespace.sh)
cd geosphere-grb/chart
export RELEASE_PREFIX="${CI_JOB_NAME/_/-}-${CI_JOB_ID/_/-}-"
export GRB_RELEASE_NAME="${RELEASE_PREFIX}-cspp-geo-grb"
helm upgrade -v 2 --install --namespace $ns -f ../../ci_tests/values-grb-g16.yaml ${GRB_RELEASE_NAME} cspp-geo-grb/

# give kubernetes a bit to create the pod
sleep 5

GRB_POD_NAME=$(kubectl -n $ns get pods --selector=app.kubernetes.io/instance=${GRB_RELEASE_NAME} -o name)
count=0
while true; do
  num_files=$(kubectl exec -n $ns ${GRB_POD_NAME} -- ls -1 /dst/products | wc -l)
  let count=count+1
  if [[ $num_files -gt 16 ]]; then
      debug "Got at least 16 files"
      break
  fi
  if [[ $count -gt 10 ]]; then
      error "Took too long for GRB to produce files"
  fi
  sleep 10
done