forked from theforeman/foreman-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·34 lines (28 loc) · 965 Bytes
/
release
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
#!/bin/bash -e
#
# simple script to create a release without tito
# it works in-place, so take care!
#
# Usage: release 1.2 el6
#
[ -z "$1" -o -z "$2" ] && echo "Usage: release version_tag dist" && exit 42
PROJECT=foreman-installer
VERSION=$1
DIST=$2
git describe $VERSION >/dev/null || echo "WARNING! There is no such tag: $VERSION!"
type librarian-puppet >/dev/null 2>&1 || gem install librarian-puppet --no-ri --no-rdoc
ruby -rpuppet -etrue >/dev/null 2>&1 || gem install puppet --no-ri --no-rdoc
RPMBUILD=$(pwd)/pkg/rpmbuild
TEMPDIR=$(mktemp -d)
trap "rm -rf $TEMPDIR" EXIT
mkdir -p $TEMPDIR/$PROJECT-$VERSION $RPMBUILD/SOURCES
cp -Rad . $TEMPDIR/$PROJECT-$VERSION
pushd $TEMPDIR
rm -rf `find -name ".git*"`
pushd $PROJECT-$VERSION
librarian-puppet install --verbose
popd
tar c $PROJECT-$VERSION | gzip -9 > $RPMBUILD/SOURCES/$PROJECT-$VERSION.tar.gz
cd $PROJECT-$VERSION
rpmbuild -bs $PROJECT.spec --define "dist $DIST" --define "_topdir $RPMBUILD"
popd