From be0d1acebc87665f1619ee32e762bb2d70248297 Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Sat, 29 Jul 2017 05:47:55 +0200 Subject: Adds annotations, assuming gnu sed --- prod-yolean.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/prod-yolean.sh b/prod-yolean.sh index fb48139..8fc91e1 100755 --- a/prod-yolean.sh +++ b/prod-yolean.sh @@ -2,8 +2,23 @@ # Combines addons into what we 'kubectl apply -f' to production set -ex +ANNOTATION_PREFIX='yolean.se/kubernetes-kafka-' +BUILD=$(basename $0) + +function annotate { + key=$1 + value=$2 + file=$3 + sed -i "s| annotations:| annotations:\n ${ANNOTATION_PREFIX}$key: '$value'|" $file +} + git fetch -git checkout origin/kafka-011 +git checkout origin/master + +echo "Working copy must be clean" +[ -z "$(git status --untracked-files=no -s)" ] +START_REV_GIT=$(git rev-parse --short HEAD) + git checkout -b prod-yolean-$(date +"%Y%m%dT%H%M%S") for BRANCH in \ @@ -14,3 +29,11 @@ for BRANCH in \ do git merge --no-ff $BRANCH -m "prod-yolean merge $BRANCH" done + +END_BRANCH_GIT=$(git rev-parse --abbrev-ref HEAD) + +for F in ./50kafka.yml ./zookeeper/50pzoo.yml ./zookeeper/51zoo.yml +do + annotate fromrev $START_REV_GIT $F + annotate build $END_BRANCH_GIT $F +done -- cgit v1.2.3