-
Notifications
You must be signed in to change notification settings - Fork 0
/
islandora-git-tag
executable file
·56 lines (50 loc) · 1.3 KB
/
islandora-git-tag
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
#!/bin/bash
# Bash script to quickly tag all Islandora Foundation modules for a release.
# Usage info
show_help() {
cat << EOF
Usage: ${0##*/} [-h] [-m MODULE LIST] [-p PATH] [-a GIT TAG A] [-t GIT TAG M] ...
Tag all Islandora Foundation modules in a given path.
-h display this help and exit
-m MODULE LIST path to line delimited list of modules.
-a GIT TAG A git tag -a. example: "7.x-1.3-RC1"
-t GIT TAG M git tag -m. example: "Islandora 7.x-1.3-RC1"
-p PATH path to the Islandora Foundation modules should be clone.
EOF
}
ISLANDORA_CLONE_PATH=""
ISLANDORA_GIT_TAGA=""
ISLANDORA_GIT_TAGM=""
ISLANDORA_MODULES_LIST=""
OPTIND=1
while getopts "h:p:m:ta:tm:" opt; do
case "$opt" in
h)
show_help
exit 0
;;
m) ISLANDORA_MODULES_LIST=$OPTARG
;;
p) ISLANDORA_CLONE_PATH=$OPTARG
;;
a) ISLANDORA_GIT_TAGA=$OPTARG
;;
t) ISLANDORA_GIT_TAGM=$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 7.x-1.6
git tag -a "$ISLANDORA_GIT_TAGA" -m "$ISLANDORA_GIT_TAGM"
git push --tags
cd ..
done
fi