-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora-release-branch
executable file
·51 lines (45 loc) · 1.17 KB
/
islandora-release-branch
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
#!/bin/bash
# Bash script to create release branches for all Islandora Foundation modules.
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-m MODULE LIST] [-p PATH] [-a GIT TAG A] [-t GIT TAG M] ...
Create release branches for all Islandora Foundation modules in a given path.
-h display this help and exit
-m MODULE LIST path to line delimited list of modules.
-b Branch name git checkout -b. example: "7.x-1.5"
-p PATH path to the Islandora Foundation modules should be clone.
EOF
}
ISLANDORA_CLONE_PATH=""
ISLANDORA_BRANCH_NAME=""
ISLANDORA_MODULES_LIST=""
OPTIND=1
while getopts "h:p:m:b:" opt; do
case "$opt" in
h)
show_help
exit 0
;;
m) ISLANDORA_MODULES_LIST=$OPTARG
;;
p) ISLANDORA_CLONE_PATH=$OPTARG
;;
b) ISLANDORA_BRANCH_NAME=$OPTARG
;;
'?')
show_help >&2
exit 1
;;
esac
done
if [[ -n $opt ]]; then
# get modules
cd "$ISLANDORA_CLONE_PATH"
cat "$ISLANDORA_MODULES_LIST" | while read line; do
cd "$line"
git checkout "$ISLANDORA_BRANCH_NAME"
git push origin "$ISLANDORA_BRANCH_NAME"
cd ..
done
fi