Commit 8cd28a5a authored by Thong Kuah's avatar Thong Kuah
Browse files

initialize_tiller and happy path test

parent d13dc234
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -82,3 +82,17 @@ test-ensure-namespace:
    - kubectl config use-context k3s
    - kubectl version
    - ensure_namespace

test-initialize-tiller:
  stage: test
  image: "$BUILD_IMAGE_NAME"
  <<: *k3s-services
  variables:
    KUBE_NAMESPACE: default
  script:
    - source /build/deploy-helpers.sh
    - kubectl config set-cluster k3s --server https://node:some-secret@k3s:6443 --insecure-skip-tls-verify
    - kubectl config set-context k3s --cluster=k3s
    - kubectl config use-context k3s
    - kubectl version
    - initialize_tiller
+16 −0
Original line number Diff line number Diff line
#! /bin/sh

export TILLER_NAMESPACE=$KUBE_NAMESPACE

function check_kube_domain() {
  if [[ -z "$KUBE_INGRESS_BASE_DOMAIN" ]]; then
    echo "In order to deploy or use Review Apps,"
@@ -40,3 +42,17 @@ function download_chart() {
function ensure_namespace() {
  kubectl get namespace "$KUBE_NAMESPACE" || kubectl create namespace "$KUBE_NAMESPACE"
}

function initialize_tiller() {
  echo "Checking Tiller..."

  export HELM_HOST="localhost:44134"
  tiller -listen ${HELM_HOST} -alsologtostderr > /dev/null 2>&1 &
  echo "Tiller is listening on ${HELM_HOST}"

  if ! helm version --debug; then
    echo "Failed to init Tiller."
    return 1
  fi
  echo ""
}