Moving dev back to LF Gerrit
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / mc-stack / charts / elasticsearch / examples / upgrade / Makefile
diff --git a/ric-aux/80-Auxiliary-Functions/helm/mc-stack/charts/elasticsearch/examples/upgrade/Makefile b/ric-aux/80-Auxiliary-Functions/helm/mc-stack/charts/elasticsearch/examples/upgrade/Makefile
new file mode 100755 (executable)
index 0000000..9e1e6fd
--- /dev/null
@@ -0,0 +1,25 @@
+default: test
+
+include ../../../helpers/examples.mk
+
+RELEASE := helm-es-upgrade
+
+# Right now the version is hardcoded because helm install will ignore
+# anything with an alpha tag when trying to install the latest release
+# This hardcoding can be removed once we drop the alpha tag
+# The "--set terminationGracePeriod=121" always makes sure that a rolling
+# upgrade is forced for this test
+install:
+       helm repo add elastic https://helm.elastic.co && \
+       helm upgrade --wait --timeout=600 --install $(RELEASE) elastic/elasticsearch --version 7.0.0-alpha1 --set clusterName=upgrade ; \
+       kubectl rollout status sts/upgrade-master --timeout=600s
+       helm upgrade --wait --timeout=600 --set terminationGracePeriod=121 --install $(RELEASE) ../../ --set clusterName=upgrade ; \
+       kubectl rollout status sts/upgrade-master --timeout=600s
+
+init:
+       helm init --client-only
+
+test: init install goss
+
+purge:
+       helm del --purge $(RELEASE)