-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithelper.sh
executable file
·76 lines (66 loc) · 1.77 KB
/
githelper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
#
# Branches
#
declare -a BRANCHES=(
"master"
"class/1-process-model"
"class/2-java-delegate"
"class/3-test-it"
"class/4-test-it-to-the-end"
"class/5-delegate-testing"
"class/6-automatic-approval"
"class/7-human-workflow"
"class/8-data-spin"
"class/9-dmn"
"class/10-listeners"
"class/11-bpmn-error"
"class/12-timer"
"class/13-messages"
"class/14-external-task"
"class/15-camunda-bpm-data"
"class/16-variable-guard"
"class/17-acl"
"class/18-jgiven"
)
echo "--------------------------------------------------"
echo "Githelper script for propagating changes"
echo "across ${#BRANCHES[*]} branches starting with ${BRANCHES[0]}."
echo "--------------------------------------------------"
git fetch --all
COMMAND=""
case "$1" in
"build")
echo "Build command detected, will execute build of every branch"
COMMAND="./mvnw clean install -T8 -B"
;;
"push")
echo "Push command detected, will push every branch"
COMMAND="git push origin"
;;
"pull")
echo "Pull command detected, will pull every branch"
COMMAND="git pull origin"
;;
"push-public")
echo "Push to publi command detected. will push every."
COMMAND="git push public"
;;
*)
echo "No command detected, will just merge branches but let them locally. Try $0 build | pull | push | push-public"
;;
esac
## now loop through the above array
for (( i = 1; i < ${#BRANCHES[*]}; ++ i ))
do
PREVIOUS="${BRANCHES[i-1]}"
CURRENT="${BRANCHES[i]}"
echo "-----"
echo "Checking out $CURRENT"
git checkout $CURRENT
echo "Merging changes from $PREVIOUS branch to $CURRENT"
git merge $PREVIOUS --no-edit
echo "Executing command $COMMAND"
$($COMMAND)
done
git checkout ${BRANCHES[0]}