|
@@ -1,23 +1,26 @@
|
|
|
#!/bin/bash
|
|
|
set -xuo pipefail
|
|
|
|
|
|
-temp_file=/tmp/fess-build.$$
|
|
|
-unzip target/releases/fess-*.zip > ${temp_file} 2>&1
|
|
|
-tail ${temp_file}
|
|
|
+temp_log_file=/tmp/fess-build.$$
|
|
|
+unzip target/releases/fess-*.zip > ${temp_log_file} 2>&1
|
|
|
+tail ${temp_log_file}
|
|
|
|
|
|
-./fess-*/bin/fess > ${temp_file} 2>&1 &
|
|
|
+./fess-*/bin/fess > ${temp_log_file} 2>&1 &
|
|
|
|
|
|
+temp_json_file=/tmp/fess-log.$$
|
|
|
+touch ${temp_json_file}
|
|
|
error_count=0
|
|
|
while true ; do
|
|
|
- status=$(curl -w '%{http_code}\n' -s -o /dev/null "http://localhost:8080/api/v1/health")
|
|
|
+ status=$(curl -w '%{http_code}\n' -s -o ${temp_json_file} "http://localhost:8080/api/v1/health")
|
|
|
+ cat ${temp_json_file}
|
|
|
if [[ x"${status}" = x200 ]] ; then
|
|
|
break
|
|
|
else
|
|
|
error_count=$((error_count + 1))
|
|
|
fi
|
|
|
- if [[ ${error_count} -ge 180 ]] ; then
|
|
|
+ if [[ ${error_count} -ge 60 ]] ; then
|
|
|
echo "Fess is not available."
|
|
|
- cat ${temp_file} ./fess-*/logs/*.log
|
|
|
+ cat ${temp_log_file} ./fess-*/logs/*.log
|
|
|
exit 1
|
|
|
fi
|
|
|
sleep 1
|
|
@@ -27,6 +30,5 @@ pushd /tmp >/dev/null
|
|
|
git clone https://github.com/codelibs/fess-testdata.git
|
|
|
popd >/dev/null
|
|
|
|
|
|
-touch $(ls -d ./fess-*/logs)/fess-crawler.log
|
|
|
-tail -f ${temp_file} ./fess-*/logs/*.log &
|
|
|
+cat ${temp_log_file} ./fess-*/logs/*.log
|
|
|
|