diff --git a/bin/compile b/bin/compile index b26371b..fccedff 100755 --- a/bin/compile +++ b/bin/compile @@ -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" @@ -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" diff --git a/bin/test b/bin/test index 33017ab..231770d 100755 --- a/bin/test +++ b/bin/test @@ -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)