Skip to content

Commit

Permalink
added autowizard / changed envvars usage / update to 2.9.0 (#17)
Browse files Browse the repository at this point in the history
* added autowizard & changed envconfig

* updated dependencies

Signed-off-by: André Bauer <[email protected]>

* updated gitignor

* more changes

Signed-off-by: André Bauer <[email protected]>

* removed whitespace

* fix volumename

* fixed reademe

* fixed env vars quotes

* fix linebreak

* fixed ports linebreak

* use json for autowizard

* updated zammad image

* added comment again

* build parallel

* renamed jobs

* changed shebang

* fixed auto_wizard.json creation
  • Loading branch information
monotek authored Feb 15, 2019
1 parent 74537f8 commit 9225548
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 140 deletions.
53 changes: 46 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,51 @@ jobs:
steps:
- checkout
- run:
name: lint
command: .circleci/lint-charts.sh
name: lint-chart
command: .circleci/lint-chart.sh

install-chart:
install-chart-k8s-1-11-3:
machine: true
environment:
CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing
CHART_TESTING_TAG: v2.2.0
CHARTS_REPO: https://github.com/zammad/helm
CHARTS_REPO: https://github.com/kiwigrid/helm-charts
KIND_VERSION: 0.1.0
K8S_VERSION: v1.11.3
steps:
- checkout
- run:
name: install
name: install-chart-k8s-1-11-3
command: .circleci/install-chart.sh
no_output_timeout: 3600

install-chart-k8s-1-12-3:
machine: true
environment:
CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing
CHART_TESTING_TAG: v2.2.0
CHARTS_REPO: https://github.com/kiwigrid/helm-charts
KIND_VERSION: 0.1.0
K8S_VERSION: v1.12.3
steps:
- checkout
- run:
name: install-chart-k8s-1-12-3
command: .circleci/install-chart.sh
no_output_timeout: 3600

install-chart-k8s-1-13-2:
machine: true
environment:
CHART_TESTING_IMAGE: quay.io/helmpack/chart-testing
CHART_TESTING_TAG: v2.2.0
CHARTS_REPO: https://github.com/kiwigrid/helm-charts
KIND_VERSION: 0.1.0
K8S_VERSION: v1.13.2
steps:
- checkout
- run:
name: install-chart-k8s-1-13-2
command: .circleci/install-chart.sh
no_output_timeout: 3600

Expand All @@ -52,9 +83,17 @@ workflows:
- lint-chart:
requires:
- lint-scripts
- install-chart:
- install-chart-k8s-1-11-3:
requires:
- lint-chart
- install-chart-k8s-1-12-3:
requires:
- lint-chart
- install-chart-k8s-1-13-2:
requires:
- lint-chart
- deploy-chart:
requires:
- install-chart
- install-chart-k8s-1-11-3
- install-chart-k8s-1-12-3
- install-chart-k8s-1-13-2
2 changes: 1 addition & 1 deletion .circleci/deploy-chart.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# deploy zammad chart to zammad.github.io
#
Expand Down
178 changes: 88 additions & 90 deletions .circleci/install-chart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,125 +6,123 @@
set -o errexit
set -o pipefail

KUBERNETES_VERSIONS=('v1.11.3' 'v1.12.3' 'v1.13.2')
REPO_ROOT="$(git rev-parse --show-toplevel)"
WORKDIR="/workdir"
CLUSTER_NAME="chart-testing"
DOCKER_NAME="ct"

if [ -n "${CIRCLE_PULL_REQUEST}" ]; then
echo -e "\\nTesting in Kubernetes ${K8S_VERSION}\\n"

run_ct_container() {
echo "Running ${DOCKER_NAME} container..."

docker container run --rm --interactive --detach --network host --name "${DOCKER_NAME}" \
--volume "${REPO_ROOT}/.circleci/ct.yaml:/etc/ct/ct.yaml" \
--volume "${REPO_ROOT}:${WORKDIR}" \
--workdir ${WORKDIR} \
"${CHART_TESTING_IMAGE}:${CHART_TESTING_TAG}" \
cat
echo
}

run_ct_container() {
echo "Running ${DOCKER_NAME} container..."

docker container run --rm --interactive --detach --network host --name "${DOCKER_NAME}" \
--volume "${REPO_ROOT}/.circleci/ct.yaml:/etc/ct/ct.yaml" \
--volume "${REPO_ROOT}:${WORKDIR}" \
--workdir ${WORKDIR} \
"${CHART_TESTING_IMAGE}:${CHART_TESTING_TAG}" \
cat
echo
}
cleanup() {
echo "Removing ${DOCKER_NAME} container..."

cleanup() {
echo "Removing ${DOCKER_NAME} container..."
docker container kill "${DOCKER_NAME}" > /dev/null 2>&1

docker container kill "${DOCKER_NAME}" > /dev/null 2>&1
echo 'Done!'
}

echo 'Done!'
}
docker_exec() {
docker container exec --interactive ct "$@"
}

docker_exec() {
docker container exec --interactive ct "$@"
}
create_kind_cluster() {
echo 'Installing kind...'

create_kind_cluster() {
echo 'Installing kind...'
curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
chmod +x kind
sudo mv kind /usr/local/bin/kind

curl -sSLo kind "https://github.com/kubernetes-sigs/kind/releases/download/${KIND_VERSION}/kind-linux-amd64"
chmod +x kind
sudo mv kind /usr/local/bin/kind
kind create cluster --name "${CLUSTER_NAME}" --config "${REPO_ROOT}"/.circleci/kind-config.yaml --image "kindest/node:${K8S_VERSION}"

kind create cluster --name "${CLUSTER_NAME}" --config "${REPO_ROOT}"/.circleci/kind-config.yaml --image "kindest/node:${K8S_VERSION}"
docker_exec mkdir -p /root/.kube

docker_exec mkdir -p /root/.kube
echo 'Copying kubeconfig to container...'
local KUBECONFIG
KUBECONFIG="$(kind get kubeconfig-path --name "${CLUSTER_NAME}")"
docker cp "${KUBECONFIG}" "${DOCKER_NAME}":/root/.kube/config

echo 'Copying kubeconfig to container...'
local KUBECONFIG
KUBECONFIG="$(kind get kubeconfig-path --name "${CLUSTER_NAME}")"
docker cp "${KUBECONFIG}" "${DOCKER_NAME}":/root/.kube/config
docker_exec kubectl cluster-info
echo

docker_exec kubectl cluster-info
echo
echo -n 'Waiting for cluster to be ready...'
until ! grep --quiet 'NotReady' <(docker_exec kubectl get nodes --no-headers); do
printf '.'
sleep 1
done

echo -n 'Waiting for cluster to be ready...'
until ! grep --quiet 'NotReady' <(docker_exec kubectl get nodes --no-headers); do
printf '.'
sleep 1
done
echo '✔︎'
echo

echo '✔︎'
echo
docker_exec kubectl get nodes
echo

docker_exec kubectl get nodes
echo
echo 'Cluster ready!'
echo
}

echo 'Cluster ready!'
echo
}
install_tiller() {
echo 'Installing Tiller...'
docker_exec kubectl --namespace kube-system create sa tiller
docker_exec kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
docker_exec helm init --service-account tiller --upgrade --wait
echo
}

install_tiller() {
echo 'Installing Tiller...'
docker_exec kubectl --namespace kube-system create sa tiller
docker_exec kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
docker_exec helm init --service-account tiller --upgrade --wait
echo
}
install_hostpath-provisioner() {
# kind doesn't support Dynamic PVC provisioning yet, this is one way to get it working
# https://github.com/rimusz/charts/tree/master/stable/hostpath-provisioner

install_hostpath-provisioner() {
# kind doesn't support Dynamic PVC provisioning yet, this is one way to get it working
# https://github.com/rimusz/charts/tree/master/stable/hostpath-provisioner
echo 'Installing hostpath-provisioner...'

echo 'Installing hostpath-provisioner...'
# Remove default storage class. Will be recreated by hostpath -provisioner
docker_exec kubectl delete storageclass standard

# Remove default storage class. Will be recreated by hostpath -provisioner
docker_exec kubectl delete storageclass standard
docker_exec helm repo add rimusz https://charts.rimusz.net
docker_exec helm repo update
docker_exec helm install rimusz/hostpath-provisioner --name hostpath-provisioner --namespace kube-system --wait
echo
}

docker_exec helm repo add rimusz https://charts.rimusz.net
docker_exec helm repo update
docker_exec helm install rimusz/hostpath-provisioner --name hostpath-provisioner --namespace kube-system --wait
echo
}
install_charts() {
docker_exec "${DOCKER_NAME}" install --config=${WORKDIR}/.circleci/ct.yaml
echo
}

install_charts() {
docker_exec "${DOCKER_NAME}" install --config=${WORKDIR}/.circleci/ct.yaml
echo
}
cleanup_cluster() {
if [ -n "$(command -v kind)" ]; then
for CLUSTER in $(kind get clusters); do
echo "delete old cluster ${CLUSTER}"
kind delete cluster --name "${CLUSTER}"
done
fi
}

cleanup_cluster() {
if [ -n "$(command -v kind)" ]; then
for CLUSTER in $(kind get clusters); do
echo "delete old cluster ${CLUSTER}"
kind delete cluster --name "${CLUSTER}"
done
fi
}
main() {
cleanup_cluster
create_kind_cluster
install_tiller
install_hostpath-provisioner
install_charts
}

run_ct_container
trap cleanup EXIT

main() {
cleanup_cluster
create_kind_cluster
install_tiller
install_hostpath-provisioner
install_charts
}

run_ct_container
trap cleanup EXIT
main

if [ -n "${CIRCLE_PULL_REQUEST}" ]; then
for K8S_VERSION in "${KUBERNETES_VERSIONS[@]}"; do
echo -e "\\nTesting in Kubernetes ${K8S_VERSION}\\n"
main
done
else
echo "skipped chart install as its not a pull request..."
fi
3 changes: 1 addition & 2 deletions .circleci/lint-charts.sh → .circleci/lint-chart.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/bin/sh
#
# lint charts
# lint chart
#

set -o errexit
set -o pipefail

CONFIG_DIR=".circleci"
GIT_REPO="https://github.com/zammad/helm"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ tmp
zammad.github.io
zammad/charts
zammad/index.yaml
zammad/requirements.lock
6 changes: 4 additions & 2 deletions zammad/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
apiVersion: v1
name: zammad
version: 0.1.10
appVersion: 2.8.0
version: 1.0.0
appVersion: 2.9.0
description: Zammad is a web based open source helpdesk/customer support system with many features to manage customer communication via several channels like telephone, facebook, twitter, chat and e-mails.
home: https://zammad.org
icon: https://raw.githubusercontent.com/zammad/zammad-documentation/master/images/zammad_logo_600x520.png
sources:
- https://github.com/zammad/zammad
- https://github.com/zammad/zammad-docker-compose
- https://github.com/zammad/zammad-helm
maintainers:
- name: monotek
email: [email protected]
Expand Down
13 changes: 12 additions & 1 deletion zammad/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ The following table lists the configurable parameters of the zammad chart and th
| `ingress.path` | Ingress path | `` |
| `ingress.hosts` | Ingress hosts | `` |
| `ingress.tls` | Ingress TLS | `[]` |
| `env` | Environment variables | `See values.yaml` |
| `envConfig.elasticsearch.host` | Elasticsearch host | `zammad-elasticsearch-client` |
| `envConfig.elasticsearch.port` | Elasticsearch port | `9200` |
| `envConfig.memcached.host` | Memcached host | `zammad-memcached` |
| `envConfig.memcached.port` | Memcached port | `11211` |
| `envConfig.postgresql.host` | PostgreSql host | `zammad-postgresql` |
| `envConfig.postgresql.port` | PostgreSql port | `5432` |
| `envConfig.postgreql.pass` | PostgreSql pass | `` |
| `envConfig.postgresql.user` | PostgreSql user | `zammad` |
| `envConfig.postgresql.db` | PostgreSql database | `zammad_production` |
| `envConfig.postgresql.dbCreate` | Create PostgreSql database | `false` |
| `autoWizard.enabled` | enable autowizard | `false` |
| `autoWizard.config` | autowizard json config | `""` |
| `persistence.enabled` | Enable persistence | `true` |
| `persistence.accessMode` | Access mode | `ReadWriteOnce` |
| `persistence.size` | Volume size | `15Gi` |
Expand Down
12 changes: 0 additions & 12 deletions zammad/requirements.lock

This file was deleted.

6 changes: 3 additions & 3 deletions zammad/requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dependencies:
- name: elasticsearch
repository: https://kubernetes-charts.storage.googleapis.com/
version: 1.15.1
version: 1.18.0
condition: useElasticsearch
- name: memcached
version: 2.4.0
version: 2.5.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: useMemcached
- name: postgresql
version: 3.7.0
version: 3.9.5
repository: https://kubernetes-charts.storage.googleapis.com/
condition: usePostgresql
Loading

0 comments on commit 9225548

Please sign in to comment.