create_deployment-package.sh 1020 Bytes
Newer Older
1
2
#!/bin/bash
#
3
# script to build and pack the project as archive for deployment
4
5
6
#
# tobias.assmann@ecsec.de

7
PCK_DIR=for_deployment-package
8
TRG_DIR=eid-server
9
10
11
12
13
14
15
16
17
TRG_ARC=eid-server.tgz

echo "checking java version ..."
command -v java 2>&1 >> /dev/null || { echo "no java found"; exit 1;}
java -version 2>&1 | awk -F '"' '/version/ {print $2}' | grep -q 1.8 || { echo "java version is not 1.8"; exit 1;}

echo "build the whole project ..."
mvn clean install || { echo "maven build failed. please check!"; exit 1; }

18
echo "copy builded stuff to $PCK_DIR/$TRG_DIR ..."
19
cp docker/poseidas/POSeIDAS-exec.jar $PCK_DIR/$TRG_DIR/poseidas/POSeIDAS-exec.jar
20
cp docker/sam/sam-1.2.0-SNAPSHOT-thorntail.jar $PCK_DIR/$TRG_DIR/sam/sam-1.2.0-SNAPSHOT-thorntail.jar
21
mkdir -p $PCK_DIR/$TRG_DIR/ssa/dist/
22
cp docker/ssa/dist/ssa-server.war $PCK_DIR/$TRG_DIR/ssa/dist/ssa-server.war
23

24
25
26
echo "archiving $PCK_DIR/$TRG_DIR to $PCK_DIR/$TRG_ARC ..."
cd $PCK_DIR
test -f $TRG_ARC && rm $TRG_ARC
27
tar -cvzf $TRG_ARC $TRG_DIR
28
cd ..
29
30
31
32

echo "done"

exit 0