From 43675f06dc23417f4edaa1048489067248e4bb7c Mon Sep 17 00:00:00 2001
From: Ulf Seltmann <seltmann@ub.uni-leipzig.de>
Date: Wed, 27 Mar 2019 08:45:53 +0100
Subject: [PATCH] * replaced chart-deletion with upgrade --force * added git
 binary to docker-image

---
 Changelog.md    | 11 ++++++++++-
 Dockerfile      |  2 +-
 Readme.md       |  2 +-
 assets/deployer | 12 +-----------
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/Changelog.md b/Changelog.md
index e678176..158c616 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -1,5 +1,13 @@
 # Changelog
 
+## [1.4.5] - 2019-03-27
+### Added
+* git-binary to docker-image
+
+### Replaced
+* `upgrade --foce` instead of explicitly deleting chart. Hopefully this will solve issues
+  with redeploying previously failed deployments
+
 ## [1.4.4] - 2019-03-18
 ### Added
 * debug-option which outputs executed commands and their arguments
@@ -95,4 +103,5 @@
 [1.4.1]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.0...release%2F1.4.1
 [1.4.2]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.1...release%2F1.4.2
 [1.4.3]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.2...release%2F1.4.3
-[1.4.4]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.3...release%2F1.4.4
\ No newline at end of file
+[1.4.4]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.3...release%2F1.4.4
+[1.4.5]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/webmasterei/deployer/compare/release%2F1.4.4...release%2F1.4.5
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 3d07374..f0e7264 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,7 @@ WORKDIR /app
 
 ENV APP_USER=deployer
 
-RUN apk add --no-cache bash curl \
+RUN apk add --no-cache bash curl git \
 	&& curl -L https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl >/usr/local/bin/kubectl \
 	&& curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.13.0-linux-amd64.tar.gz | tar -zxf - -C /tmp linux-amd64/helm -O >/usr/local/bin/helm \
 	&& chmod a+x /usr/local/bin/deployer /usr/local/bin/kubectl /usr/local/bin/helm \
diff --git a/Readme.md b/Readme.md
index 789eac2..21aa6bd 100644
--- a/Readme.md
+++ b/Readme.md
@@ -116,7 +116,7 @@ From now on charts located in this repository can be deployed by using the `--ch
 * `--input`: sets the filepath to the file from where the image is loaded
 * `--docker-config`: sets the content of the file `~/.docker/config.json` which is used by docker to authenticate to the registry. This can contain multiple registry-servers and there credentials. Which registry is used depends on the image name.
 * `--name`: sets the name of the image. If you do not wish to publish to [Docker-Hub], you have to specify a server, e.g. `registry.example.com/my-image`. **Be aware that you need to provide credentials in your docker-config if the registry requires authentication.
-* `--tags`: sets the tags of the image. Provide multiple `--tag`-options if you wish to tag an image with multiple tags.
+* `--tag`: sets the tags of the image. Provide multiple `--tag`-options if you wish to tag an image with multiple tags.
 * `--reset`: this ignores eventually existing config-folders of docker, helm and kubectl and removes them.
 * `--image-name`: specifys the image name in the local docker-registry to publish
 * `--debug`: outputs executed commands
diff --git a/assets/deployer b/assets/deployer
index 0282e8c..4f5a483 100755
--- a/assets/deployer
+++ b/assets/deployer
@@ -328,19 +328,9 @@ helm_deploy() {
 	local out
 	local cmd
 
-	if [ "$(helm ls --tiller-namespace=${namespace} --namespace=${namespace} --pending --deleted --failed --short | grep ${name})" != "" ];then
-		debug "helm delete --tiller-namespace=${namespace} --purge ${name}"
-		out=`helm delete --tiller-namespace=${namespace} --purge ${name} 2>&1`
-		if [ "$?" != "0" ];then
-			echo "failed"
-			echo "$out"
-			return 1
-		fi
-	fi
-
 	helmargs=$(echo -e "$helmargs" | sed -E 's/(^[[:space:]]*)|([[:space:]]*$)//g')
 	cmd="helm upgrade --install --wait --timeout=${timeout} --tiller-namespace=${namespace} --namespace=${namespace}"
-	cmd="$cmd --namespace=${namespace} --recreate-pods ${name} ${charts} ${helmargs}"
+	cmd="$cmd --namespace=${namespace} --force --recreate-pods ${name} ${charts} ${helmargs}"
 	debug "$cmd"
 	out=`$cmd 2>&1`
 	if [ "$?" != "0" ];then
-- 
GitLab