]> rtime.felk.cvut.cz Git - jailhouse.git/blob - scripts/make_release
scripts: Add release-maker script
[jailhouse.git] / scripts / make_release
1 #!/bin/sh
2
3 usage() {
4         echo "usage: $0 name"
5         exit 1
6 }
7
8 name=$1
9
10 if [ -z "$name" ]; then
11         usage
12 fi
13
14 if [ ! -f VERSION ] || [ ! -d .git ]; then
15         echo "Must be run from top-level directory"
16         exit 1
17 fi
18
19 if [ -n "`git status -s -uno`" ]; then
20         echo "Working directory is dirty!"
21         exit 1
22 fi
23
24 echo -e "Tag commit\n\n    `git log -1 --oneline`"
25 echo -e "\nof branch\n\n    `git branch | sed -n 's/^\* //p'`"
26 echo -ne "\nas $name? (y/N) "
27 read answer
28 if [ "$answer" != "y" ]; then
29         exit 1
30 fi
31
32 echo $name > VERSION
33 git commit -sv VERSION -m "Bump version number"
34 git tag -as $name -m "Release $name"