-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackit.sh
executable file
·49 lines (39 loc) · 1.03 KB
/
packit.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
#!/bin/sh
#
# Author: Jochen Schäfer <[email protected]>, 2001-2007
#
# copyright (c) Novell Deutschland GmbH, 2007. All rights reserved.
# GNU Public Licence
#
# packit.sh 31 Mär 2016
customer=$1
current_workdir=$(pwd)/workdir/currentwebapp/
if [ -n "$customer" ];then
test -d $customer
if [ $? -ne 0 ];then
echo -ne "Directory $customer does not exist\n"
exit 1
fi
else
echo -ne "Please specify a customer\n"
exit 1
fi
if [ ${customer:(-1)} == "/" ];then
customer=${customer:0:-1}
fi
environ=$(awk -F '=' '$1~"CUSTOMER_ENV.LOWER"{print $2}' $(pwd)/ncif_customTemplate/ant/clone.properties)
cd $customer
version=$(awk -F':' '/Implementation-Version/{gsub(" ","");print $2}' META-INF/MANIFEST.MF)
rm -r currentwebapp
mkdir -p currentwebapp
cp -a nps/* currentwebapp
#cp -a $current_workdir/* currentwebapp
grep -q [[:alnum:]] <<<$environ
if [ $? -eq 0 ];then
my_npm=${customer}-${environ}-${version}.npm
else
my_npm=${customer}-${version}.npm
fi
/usr/bin/jar cvfm $my_npm META-INF/MANIFEST.MF currentwebapp/
mv $my_npm ../
cd -