aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStaffan Olsson <staffan@repos.se>2017-07-29 14:27:40 +0200
committerStaffan Olsson <staffan@repos.se>2017-07-29 14:43:00 +0200
commit4ece24cb9430c8407efc50d79ff06c8c0a524641 (patch)
tree886df815a8d29f9bd2d3b9b4da2d43c582039db8
parent7a1173be5fbd5f334e4ffe96b33358ade933ea94 (diff)
downloadkubernetes-kafka-4ece24cb9430c8407efc50d79ff06c8c0a524641.tar.gz
kubernetes-kafka-4ece24cb9430c8407efc50d79ff06c8c0a524641.tar.bz2
kubernetes-kafka-4ece24cb9430c8407efc50d79ff06c8c0a524641.zip
There's probably a tool out there for combining branches
-rwxr-xr-xprod-yolean.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/prod-yolean.sh b/prod-yolean.sh
index 80cb893..88ea25c 100755
--- a/prod-yolean.sh
+++ b/prod-yolean.sh
@@ -4,6 +4,11 @@ set -ex
ANNOTATION_PREFIX='yolean.se/kubernetes-kafka-'
BUILD=$(basename $0)
+REMOTE=origin
+FROM="$REMOTE/"
+START=master
+
+[ ! -z "$(git status --untracked-files=no -s)" ] && echo "Working copy must be clean" && exit 1
function annotate {
key=$1
@@ -21,12 +26,8 @@ function annotate {
esac
}
-git fetch
-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 ${FROM}$START
+REVS="$START:$(git rev-parse --short ${FROM}$START)"
git checkout -b prod-yolean-$(date +"%Y%m%dT%H%M%S")
@@ -36,13 +37,14 @@ for BRANCH in \
addon-rest \
addon-kube-events-topic
do
- git merge --no-ff $BRANCH -m "prod-yolean merge $BRANCH"
+ git merge --no-ff ${FROM}$BRANCH -m "prod-yolean merge ${FROM}$BRANCH" && \
+ REVS="$REVS $BRANCH:$(git rev-parse --short ${FROM}$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
+ annotate revs "$REVS" $F
+ annotate build "$END_BRANCH_GIT" $F
done