This repository has been archived by the owner on Dec 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbuild.sh
executable file
·71 lines (53 loc) · 2.14 KB
/
build.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# This file is part of the Zimbra OpenPGP Zimlet project.
# Copyright (C) 2014-2016 Barry de Graaff
#
# Bugs and feedback: https://github.com/Zimbra-Community/pgp-zimlet/issues
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
# This script does some checks and creates a zip file for zimlet release
# check number of parameters in command
PARAMS=1
if [ $# -ne "$PARAMS" ]
then
echo
echo "Please specify version number, for example: 1.2.3"
echo
exit 1
fi
if grep --quiet $1 README.md; then
echo "OK version number found in README.md"
else
echo "FAIL version number not found in README.md"
exit 0
fi
if grep --quiet $1 tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.xml; then
echo "OK version number found in tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.xml"
else
echo "FAIL version number not found in tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.xml"
exit 0
fi
echo "Make a copy of the source"
rm -Rf /tmp/tk_barrydegraaff_zimbra_openpgp
mkdir /tmp/tk_barrydegraaff_zimbra_openpgp
cp -r -v tk_barrydegraaff_zimbra_openpgp /tmp/
echo "Build release zip"
cd /tmp/tk_barrydegraaff_zimbra_openpgp
rm -Rf /tmp/tk_barrydegraaff_zimbra_openpgp/lang
zip -r tk_barrydegraaff_zimbra_openpgp.zip *
rm /tmp/tk_barrydegraaff_zimbra_openpgp.zip
mv /tmp/tk_barrydegraaff_zimbra_openpgp/tk_barrydegraaff_zimbra_openpgp.zip /tmp/tk_barrydegraaff_zimbra_openpgp.zip
rm -Rf /tmp/tk_barrydegraaff_zimbra_openpgp
echo 'All done, your release zip should be here: /tmp/tk_barrydegraaff_zimbra_openpgp.zip'
exit 0