forked from leoleovich/grafsy
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrelease.sh
executable file
·51 lines (38 loc) · 1.38 KB
/
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
#!/bin/bash -e
MIN_GBP='0.9.12'
GBP_VERSION="$(gbp --version)"
if ! (echo "gbp ${MIN_GBP}"; echo "${GBP_VERSION}") | sort -Vc 2>/dev/null ; then
echo "Minimal version for git-buildpackage is ${MIN_GBP}. Provided is ${GBP_VERSION}"
exit 1
fi
#=== FUNCTION ================================================================
# NAME: usage
# DESCRIPTION: Display usage information.
#===============================================================================
function usage ()
{
echo "Usage : $0 [options] [--]
Options:
-h|help Display this message
-n|new-version New version for changelog"
} # ---------- end of function usage ----------
#-----------------------------------------------------------------------
# Handle command line arguments
#-----------------------------------------------------------------------
while getopts ":hn:" opt
do
case $opt in
h ) usage; exit 0 ;;
n ) NEW_VERSION="${OPTARG}" ;;
: ) echo "Invalid option: -$OPTARG requires an argument" 1>&2; exit 1 ;;
* ) echo -e "\n Option does not exist : $OPTARG\n"
usage; exit 1 ;;
esac # --- end of case ---
done
shift $((OPTIND -1))
if [ -z "${NEW_VERSION}" ]; then
echo 'New debian version is not set' 1>&2
exit 1
fi
gbp dch --git-author --distribution=stretch --force-distribution --ignore-branch --commit -N "${NEW_VERSION}" --auto
git tag "v${NEW_VERSION}"