moya.patch
1.15 KB
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
--- a/generate_deploy_commands.sh
+++ b/generate_deploy_commands.sh
@@ -18,6 +18,30 @@
# a single application exists in the $DEPLOY_DIR directory.
################################################################################
+if ls ${PAYARA_PATH}/glassfish/domains/${PAYARA_DOMAIN}/applications \
+ 2>/dev/null | grep -qv '^__internal$'
+ then
+ > ${POSTBOOT_COMMANDS}
+else
+ if [ -x ${PAYARA_PATH}/bin/mkconf.sh ]
+ then
+ ${PAYARA_PATH}/bin/mkconf.sh
+ fi
+fi
+
+allapps=$(find "${DEPLOY_DIR}" -maxdepth 1 -type f \
+ \( -iname '*.ear' -or -iname '*.jar' -or -iname '*.war' \))
+
+CHECKSUMS=/tmp/sha512sums
+
+if [ -e $CHECKSUMS ]
+ then
+ apps=$(sha512sum -c $CHECKSUMS 2>/dev/null \
+ | grep ': FAILED$' | sed 's/: FAILED$//')
+else
+ apps=${allapps}
+fi
+
if [ x$1 != x ]
then
DEPLOY_OPTS="$*"
@@ -24,7 +48,12 @@
fi
echo '# deployments after boot' >> $POSTBOOT_COMMANDS
-for deployment in "${DEPLOY_DIR}"/*
+for deployment in ${apps}
do
echo "deploy --force --enabled=true $DEPLOY_OPTS $deployment" >> $POSTBOOT_COMMANDS
done
+
+if [ "x${apps}" != "x" ]
+ then
+ sha512sum ${allapps} > $CHECKSUMS
+fi