-
Notifications
You must be signed in to change notification settings - Fork 314
/
Copy pathrelease.sh
executable file
·38 lines (27 loc) · 1.01 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
#!/bin/bash
set -e
# This script should be run after the build/tests have successfully completed
# Prune any local tags that aren't on the remote
git fetch --prune origin "+refs/tags/*:refs/tags/*"
cd $WORKSPACE
# Let's get version from maven
MVNVER=`xmllint --xpath "/*[local-name()='project']/*[local-name()='version']/text()" pom.xml`
TAG_NAME="v${MVNVER/-SNAPSHOT/}"
echo "Current tag name: $TAG_NAME"
if ! git rev-parse $TAG_NAME >/dev/null 2>&1
then
git tag -a $TAG_NAME -m "Tagged automatically by Jenkins"
git push origin $TAG_NAME
else
echo "Tag: $TAG_NAME already exists."
fi
VERSION_FULL=`git describe --match "v[0-9\.]*" --long`
echo "Full version: ${VERSION_FULL}"
VERSION=${VERSION_FULL:1}
echo "Package version: ${VERSION}"
REV=$(git log --pretty=format:'%h' -n 1)
# bulding the debian package expects the file target/jibri.jar
mv target/jibri-${MVNVER}-jar-with-dependencies.jar target/jibri.jar
dch -v "${VERSION}-1" "Built from git. $REV"
dch -D unstable -r ""
dpkg-buildpackage -A -rfakeroot -us -uc