summaryrefslogtreecommitdiff
path: root/tools/make_tarball.sh
blob: cc371ca0669e340f317ac39a6313a698f3e07afb (plain)
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
#! /bin/sh

# Release package script.
#
# Usage: ./make_tarball [version git-tag-name]
#

case $# in
0)
	BRANCH=master
	VERSION=snapshot
	;;
2)
	BRANCH=$2
	VERSION=$1
	;;
*)
	echo "Usage: $0 version git-branch-name" 1>&2
	exit 1
	;;
esac

PACKAGE_DIR=pgpoolAdmin-$VERSION

echo "1. git clone"
rm -rf $PACKAGE_DIR
git clone ssh://[email protected]/pgpooladmin.git $PACKAGE_DIR
echo ""

echo "2. git checkout"
cd $PACKAGE_DIR
git checkout $BRANCH
cd ../
echo ""

echo "3. Arrange dirs"
mkdir $PACKAGE_DIR/templates_c
find $PACKAGE_DIR -name tools -type d | xargs rm -rf
find $PACKAGE_DIR -name .git -type d | xargs rm -rf

echo "4. make tar ball"
tar czf $PACKAGE_DIR.tar.gz $PACKAGE_DIR