forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtag_release.sh
executable file
·64 lines (45 loc) · 1.31 KB
/
tag_release.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
#!/bin/bash
function delete_branch {
git checkout master
git br -D ${1}
git push origin :${1}
}
function get_property {
echo $(grep "${1}=" release.properties | cut -d"=" -f2)
}
function main {
pushd $(git rev-parse --show-toplevel) > /dev/null
local branch=$(parse_git_current_branch)
local repo_dir=${PWD}
local repo_name=$(basename ${PWD})
if [ ${repo_name} == "liferay-portal" ]
then
local hash=$(git rev-parse HEAD)
local release_info_version_trivial=$(get_property "release.info.version.trivial")
push_tag 7.4.3.${release_info_version_trivial}-ga${release_info_version_trivial} ${hash}
if [ ${branch} != "master" ]
then
delete_branch release-7.4.13.${release_info_version_trivial}
fi
cd ../liferay-portal-ee
git fetch -f ../liferay-portal ${hash}
push_tag 7.4.3.${release_info_version_trivial}-ga${release_info_version_trivial} ${hash}
push_tag 7.4.13-u${release_info_version_trivial} ${hash}
if [ ${branch} != "master" ]
then
delete_branch release-7.4.13.${release_info_version_trivial}
fi
else
echo "${repo_dir} is an invalid directory for committing a release."
fi
popd > /dev/null
}
function parse_git_current_branch {
git rev-parse --abbrev-ref HEAD 2>/dev/null
}
function push_tag {
git tag ${1} ${2}
git push origin ${1}
git push upstream ${1}
}
main "${@}"