-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathinstall.sh
executable file
·50 lines (41 loc) · 1.57 KB
/
install.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
#!/usr/bin/env bash
function waiting_for_jboss {
for port in "9990" "9999" ; do
while [[ $(sudo netstat -ltnp | grep ${port} | wc -l) -lt 1 ]] ; do sleep 1s ; done
done
}
waiting_for_jboss
if [ "${JBOSS_EAP_PATCH}" != "6.4.0" ] ; then
mkdir -p ./patches
wget -q -i "${PATCHES_BASE_URL}/index.txt" -P ./patches/ || echo "no patches found."
for PATCH_FILENAME in $(ls ./patches/*.zip) ; do
echo "Applying $(basename ./patches/${PATCH_FILENAME}) file..."
INSTRUCTIONS_FILE="${PATCH_FILENAME}.instructions"
# modification manual resolution problem solving:
if [[ ${PATCH_FILENAME} == *-6.4.19-patch.zip ]] ; then
echo "connect
patch apply ${PATCH_FILENAME} --override=bin/standalone.conf,bin/standalone.conf.bat
shutdown --restart=true" > ${INSTRUCTIONS_FILE}
else
echo "connect
patch apply ${PATCH_FILENAME}
shutdown --restart=true" > ${INSTRUCTIONS_FILE}
fi
jboss-cli.sh --file=${INSTRUCTIONS_FILE}
rm -rf ${INSTRUCTIONS_FILE} ${PATCH_FILENAME}
waiting_for_jboss
done
fi
if [ -z ${KEEP_HISTORY} ] || [[ ! ${KEEP_HISTORY} =~ ^(keep|yes|true)$ ]] ; then
echo "Cleanup patches history..."
jboss-cli.sh --commands="connect","/core-service=patching:ageout-history"
fi
echo "Shutdown JBoss..."
jboss-cli.sh --commands="connect","shutdown --restart=false"
if [ -z ${KEEP_HISTORY} ] || [[ ! ${KEEP_HISTORY} =~ ^(keep|yes|true)$ ]] ; then
echo "Cleanup tmp, data, logs..."
for FOLDER in "tmp" "data" "log" ; do
sudo rm -rf ${JBOSS_HOME}/standalone/${FOLDER}
done
fi
echo "Done."