forked from smooks/unedifact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·64 lines (49 loc) · 1.06 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
#!/bin/bash
set -e
ROOT_DIR=$PWD
DEPLOY="no"
STRTAT=""
while getopts d:u:p:g:s: option
do
case "${option}"
in
d) DEPLOY=${OPTARG};;
u) USERNM=${OPTARG};;
p) PASSWD=${OPTARG};;
g) GPGPPH=${OPTARG};;
s) STRTAT=${OPTARG};;
esac
done
export CH_UN="$USERNM"
export CH_PW="$PASSWD"
if [ $DEPLOY = "yes" ]; then
echo "Deploying is turned ON!"
fi
exec_mvn() {
if [ -d $1 ]; then
if [ "$STRTAT" != "" ] && [ "./$STRTAT" != "$1" ]; then
echo "Skipping $1"
return 0
fi
STRTAT=""
pushd $1
if [ $DEPLOY = "yes" ]; then
echo "Deploying $1"
mvn clean deploy -Pdeploy -Dgpg.passphrase="$GPGPPH" -Dmaven.test.skip=true --settings $ROOT_DIR/settings_codehaus.xml
else
echo "Installing $1"
mvn clean install
fi
popd
fi
}
exec_mvn ./parent
# Re-add directory list as a parameter
set ./d*
for directory;
do
if [ -d "$directory" ]; then
exec_mvn $directory
fi
done
DEPLOY="no"