Commit e7e2e754 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Added kubernetes deploy script.

parent fdd546a3
Pipeline #42827 passed with stages
in 19 minutes and 22 seconds
......@@ -24,6 +24,9 @@ variables:
RAWAPI_TEST_IMAGE: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair/rawapi:test
RAWAPI_RELEASE_IMAGE: gitlab-registry.mpcdf.mpg.de/nomad-lab/nomad-fair/rawapi:latest
KUBECONFIG: /etc/deploy/config
STAGING_NAMESPACE: nomad-fairdi
build:
stage: build
script:
......@@ -190,3 +193,27 @@ deploy_rawapi:
except:
- /^dev-.*$/
when: manual
deploy_kubernetes:
stage: deploy
image: dtzar/helm-kubectl
before_script:
- mkdir -p /etc/deploy
# kube_config is a CI/CD variable set in GitLab GUI
- echo ${kube_config} | base64 -d > /etc/deploy/config
# - kubectl config use-context homekube
- helm init --client-only
- helm repo add stable https://kubernetes-charts.storage.googleapis.com/
- helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
- helm repo update
script:
- cd ops/helm/nomad
- helm dep build
- export API_VERSION="$(grep "version" Chart.yaml | cut -d" " -f2)"
- export RELEASE_NAME="kubetest-v${API_VERSION/./-}"
- export DEPLOYS=$(helm ls | grep $RELEASE_NAME | wc -l)
- export EXTERNAL_PATH="/nomad/kubetest/v${API_VERSION}
- if [ ${DEPLOYS} -eq 0 ]; then helm install --name=${RELEASE_NAME} . --namespace=${STAGING_NAMESPACE} --set proxy.external.path=${EXTERNAL_PATH}; else helm upgrade ${RELEASE_NAME} . --namespace=${STAGING_NAMESPACE}; fi
except:
- /^dev-.*$/
when: manual
......@@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes that only runs nomad services and uses externally hosted databases.
name: nomad
version: 0.1.0
version: 0.3.0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment