Skip to content

Commit a348769

Browse files
committed
There's probably a tool out there for combining branches
1 parent 7a1173b commit a348769

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

prod-yolean.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -ex
44

55
ANNOTATION_PREFIX='yolean.se/kubernetes-kafka-'
66
BUILD=$(basename $0)
7+
REMOTE=origin
8+
FROM="$REMOTE/"
9+
START=master
10+
11+
[ ! -z "$(git status --untracked-files=no -s)" ] && echo "Working copy must be clean" && exit 1
712

813
function annotate {
914
key=$1
@@ -21,12 +26,8 @@ function annotate {
2126
esac
2227
}
2328

24-
git fetch
25-
git checkout origin/master
26-
27-
echo "Working copy must be clean"
28-
[ -z "$(git status --untracked-files=no -s)" ]
29-
START_REV_GIT=$(git rev-parse --short HEAD)
29+
git checkout ${FROM}$START
30+
REVS="$START:$(git rev-parse --short ${FROM}$START)"
3031

3132
git checkout -b prod-yolean-$(date +"%Y%m%dT%H%M%S")
3233

@@ -36,13 +37,14 @@ for BRANCH in \
3637
addon-rest \
3738
addon-kube-events-topic
3839
do
39-
git merge --no-ff $BRANCH -m "prod-yolean merge $BRANCH"
40+
git merge --no-ff ${FROM}$BRANCH -m "prod-yolean merge ${FROM}$BRANCH" && \
41+
REVS="$REVS $BRANCH:$(git rev-parse --short ${FROM}$BRANCH)"
4042
done
4143

4244
END_BRANCH_GIT=$(git rev-parse --abbrev-ref HEAD)
4345

4446
for F in ./50kafka.yml ./zookeeper/50pzoo.yml ./zookeeper/51zoo.yml
4547
do
46-
annotate fromrev $START_REV_GIT $F
48+
annotate revs $REVS $F
4749
annotate build $END_BRANCH_GIT $F
4850
done

0 commit comments

Comments
 (0)