Skip to content

Commit

Permalink
Fix: data symlink is needed in compile and test
Browse files Browse the repository at this point in the history
Delete the symlink later and create it for testing.
  • Loading branch information
simar0at committed Mar 28, 2024
1 parent 40c56af commit 33233e5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ install_bins() {

pushd "$BUILD_DIR/.heroku/basex/bin" >/dev/null
mv "$BUILD_DIR/.heroku/basex/data" "$BUILD_DIR/.heroku/basex/data.image"
ln -s data.image "$BUILD_DIR/.heroku/basex/data"
BASEX_admin_pw="${BASEX_admin_pw:-$(openssl rand -base64 12)}"
echo "BASEX_admin_pw=\"$BASEX_admin_pw\"" > "$BUILD_DIR/.heroku/basex/data/credentials"
echo "CYPRESS_BASEX_admin_pw=\"$BASEX_admin_pw\"" >> "$BUILD_DIR/.heroku/basex/data/credentials"
Expand Down Expand Up @@ -357,6 +358,7 @@ install_bins() {
rm $BUILD_DIR/.heroku/basex/webapp/restxq.xqm
fi
rm -rf $BUILD_DIR/.heroku/basex/webapp/[a-z]*
rm "$BUILD_DIR/.heroku/basex/data"
}

header "Installing binaries" | output "$LOG_FILE"
Expand Down
7 changes: 7 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
BUILD_DIR=${1:-}
PORT=${PORT:-8984}

if [ -z "$(ls -A $BUILD_DIR/.heroku/basex/data 2>/dev/null)" ]
then
cp -ra "$BUILD_DIR/.heroku/basex/data.image/." "$BUILD_DIR/.heroku/basex/data"
else
ln -s data.image "$BUILD_DIR/.heroku/basex/data"
fi

bash "$BUILD_DIR/.heroku/basex/bin/basexhttp" -h "$PORT" &
(curl --connect-timeout 5 --max-time 10 --retry 3 --retry-delay 0 --retry-max-time 40 --retry-connrefused 0 -s -D - "http://localhost:$PORT" -o /dev/null | head -n1 | grep -q '\([23]0[0-9]\)') || (pkill -TERM java; exit 1)

Expand Down

0 comments on commit 33233e5

Please sign in to comment.