-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdpack.sh
executable file
·55 lines (48 loc) · 1.71 KB
/
dpack.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
#!/bin/bash
#set -x
onlyIotus=0
if [ $# > 0 ] && [ "$1" == "onlyIotus" ] ; then
echo onlyIotus
onlyIotus=1
fi
echo onlyIotus: $onlyIotus
# pack binaries for docker
# ./gradlew build and ./deploy.sh must have been ran before
#version = '0.1.01'
version=$(awk -F\' '/version = / {print $2}' ./build.gradle)
BINDIR=build/iotan-hs-bin-$version
TARNAME_ALL=iotan-hs-bin-all-$version.tar.gz
TARNAME_DEPS=iotan-hs-bin-deps-$version.tar.gz
TARNAME_IOTAN=iotan-hs-bin-$version.tar.gz
# first cleanup from previous build
for f in iotan-hs-bin-dev-$version iotan-hs-bin-all-$version iotan-hs-bin-$version ; do
rm -rf build/$f
done
mkdir $BINDIR
cp -a *.sh $BINDIR
cp -a winstone.properties winstone*jar $BINDIR
cp -a WEB-INF $BINDIR
cd build
mkdir -p ./iotan-hs-bin-deps-$version/WEB-INF/lib
mkdir ./iotan-hs-bin-all-$version
# all, just replicate the dir
cp -a ./iotan-hs-bin-$version/* ./iotan-hs-bin-all-$version
# deps: only lib dir
mv ./iotan-hs-bin-$version/WEB-INF/lib/* ./iotan-hs-bin-deps-$version/WEB-INF/lib
# iotan: all minus non-iotan libs delete from lib/*
mv ./iotan-hs-bin-deps-$version/WEB-INF/lib/iotus* ./iotan-hs-bin-$version/WEB-INF/lib/
echo tar zcvf ../$TARNAME_IOTAN ./iotan-hs-bin-$version/
tar zcvf ../$TARNAME_IOTAN ./iotan-hs-bin-$version/
if [ $onlyIotus != 0 ] ; then
cd ..
echo 1 new file was created iotus-only:
ls -l $TARNAME_IOTAN
else
echo tar zcvf ../$TARNAME_ALL ./iotan-hs-bin-all-$version
tar zcvf ../$TARNAME_ALL ./iotan-hs-bin-all-$version
echo tar zcvf ../$TARNAME_DEPS ./iotan-hs-bin-deps-$version
tar zcvf ../$TARNAME_DEPS ./iotan-hs-bin-deps-$version
cd ..
echo 3 new files were created for all, deps, iotus-only:
ls -l $TARNAME_ALL $TARNAME_DEPS $TARNAME_IOTAN
fi