-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathcreate-blank-zip.sh
41 lines (36 loc) · 1.07 KB
/
create-blank-zip.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
#!/bin/sh
set -e
# export DIRNAME=`dirname \`pwd\``-`date '+%Y%m%d'`
export DIRNAME=`dirname \`pwd\``-$VERSION
export FNAME=`basename $DIRNAME`
export FNAME_D=$FNAME-with-dependencies
#----------------------------------------
# remove metafiles
#----------------------------------------
rm -rf `find . -type d -name .svn`
rm -rf `find . -type d -name .git`
rm -f `find . -type f -name .gitkeep`
rm -f `find . -type f -name .gitignore`
#----------------------------------------
# create directory to make zip for maven project
#----------------------------------------
rm -rf $FNAME
mkdir -p $FNAME
cp -r src pom.xml $FNAME/
zip -r $FNAME.zip $FNAME
#----------------------------------------
# maven project -> WTP project with dependencies
#----------------------------------------
rm -rf $FNAME_D
mkdir -p $FNAME_D
cp -r src pom.xml *.sh $FNAME_D/
pushd $FNAME_D
sh unmaven-project.sh $JOB_NAME
rm -f *.sh
popd
zip -r $FNAME_D.zip $FNAME_D
#----------------------------------------
# remove trash
#----------------------------------------
rm -rf *.sh *.xml src infra
rm -rf $FNAME $FNAME_D