Skip to content

Commit

Permalink
update github action script
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Feb 9, 2024
1 parent 03f32cb commit 7de4b10
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
branches:
- master
- "*.x"
workflow_dispatch:

jobs:
build:
Expand Down
35 changes: 23 additions & 12 deletions src/test/resources/before_script.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
#!/bin/bash
set -euo pipefail

TMP_FILE=/tmp/fess-build.$$
unzip target/releases/fess-*.zip 2>&1 > $TMP_FILE
tail $TMP_FILE
temp_file=/tmp/fess-build.$$
unzip target/releases/fess-*.zip > ${temp_file} 2>&1
tail ${temp_file}

./fess-*/bin/fess 2>&1 > $TMP_FILE &
./fess-*/bin/fess > ${temp_file} 2>&1 &
fess_pid=$!

pushd /tmp
pushd /tmp >/dev/null
git clone https://github.com/codelibs/fess-testdata.git
popd
popd >/dev/null

tail $TMP_FILE
touch `ls -d ./fess-*/logs`/fess-crawler.log
tail ${temp_file}
touch $(ls -d ./fess-*/logs)/fess-crawler.log
tail -f ./fess-*/logs/*.log &

response_file=/tmp/response.$$
counter=0
ret=1
while [ $ret != 0 -a $counter != 180 ] ; do
while [[ $ret != 0 && $counter -lt 180 ]]; do
echo "Ping Fess... $counter"
curl -v "localhost:8080/json/?type=ping"
ret=$?
if ! curl -o ${response_file} -v "localhost:8080/api/v1/health"; then
ret=$?
else
ret=0
fi
sleep 1
counter=$((counter + 1))
((counter++))
done

cat ${response_file}
if ! grep green ${response_file} >/dev/null; then
exit $?
fi

0 comments on commit 7de4b10

Please sign in to comment.