-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·33 lines (26 loc) · 1.11 KB
/
deploy.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
#!/bin/bash
PM_FILE="Koha/Plugin/Fi/KohaSuomi/MorememberBorrowerBarcode.pm"
VERSION=`grep -oE "\-?[0-9]+\.[0-9]+\.[0-9]" $PM_FILE | head -1`
MINVERSION=`grep -oE "\-?[0-9]+\.[0-9][0-9]" $PM_FILE | head -1`
CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ "$CURRENT_BRANCH" == "master" ]; then
VERSIONTAG=`git tag -l "v${VERSION}-koha-$MINVERSION"`
RELEASE_FILE="koha-plugin-intranetjs-moremember-borrower-barcode-v${VERSION}.kpz"
else
VERSIONTAG=`git tag -l "v${VERSION}-koha-$MINVERSION-$CURRENT_BRANCH"`
RELEASE_FILE="koha-plugin-intranetjs-moremember-borrower-barcode-v${VERSION}.kpz"
fi
if [ $VERSIONTAG ]; then
echo "Release version already exists!"
exit 1
fi
rm $RELEASE_FILE
echo "Building release package ${RELEASE_FILE}"
zip -r $RELEASE_FILE ./Koha
if [ "$CURRENT_BRANCH" == "master" ]; then
echo "Creating tag v${VERSION}-koha-$MINVERSION"
git tag -a "v${VERSION}-koha-$MINVERSION" -m "Release ${VERSION}"
else
echo "Creating tag v${VERSION}-koha-$MINVERSION-$CURRENT_BRANCH"
git tag -a "v${VERSION}-koha-$MINVERSION-$CURRENT_BRANCH" -m "Release ${VERSION}-$CURRENT_BRANCH"
fi