diff --git a/build/post-build.sh b/build/post-build.d/10-database-tests.sh old mode 100755 new mode 100644 similarity index 100% rename from build/post-build.sh rename to build/post-build.d/10-database-tests.sh diff --git a/build/post-build.d/20-import-tools.sh b/build/post-build.d/20-import-tools.sh new file mode 100644 index 0000000..2b20f04 --- /dev/null +++ b/build/post-build.d/20-import-tools.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +TESTDIR=`mktemp -d` +cp -Rapv legacyworlds-server-DIST/target/legacyworlds/legacyworlds-server-* $TESTDIR + + +cd $TESTDIR/legacyworlds-server-*/sql +cat > db-config.txt < data-source.xml < + + + + + + + + + + +EOF + +java legacyworlds-server-main-*.jar --run-tool ImportText data/i18n-text.xml || exit 1 +java legacyworlds-server-main-*.jar --run-tool ImportResources data/resources.xml || exit 1 +java legacyworlds-server-main-*.jar --run-tool ImportTechs data/techs.xml || exit 1 +java legacyworlds-server-main-*.jar --run-tool ImportBuildables data/buildables.xml || exit 1 + +java legacyworlds-server-main-*.jar & +sleep 10 +if ! ps ux | grep -q 'java -jar legacyworlds-server-main'; then + exit 1; +fi +java legacyworlds-server-main-*.jar --run-tool Stop || { + killall java + exit 1; +} + +java -jar legacyworlds-server-main-1.0.0-0.jar --run-tool CreateUser 'test@example.org 12blah34bleh en' || exit 1 +java -jar legacyworlds-server-main-1.0.0-0.jar --run-tool CreateSuperuser 'test@example.org Turlututu' || exit 1 diff --git a/legacyworlds/doc/local-deployment.txt b/legacyworlds/doc/local-deployment.txt index 4ca29a8..24669c3 100644 --- a/legacyworlds/doc/local-deployment.txt +++ b/legacyworlds/doc/local-deployment.txt @@ -41,6 +41,8 @@ from the root of the server's distribution: --run-tool ImportText data/i18n-text.xml java -jar legacyworlds-server-main-1.0.0-0.jar \ --run-tool ImportTechs data/techs.xml + java -jar legacyworlds-server-main-1.0.0-0.jar \ + --run-tool ImportResources data/resources.xml java -jar legacyworlds-server-main-1.0.0-0.jar \ --run-tool ImportBuildables data/buildables.xml @@ -83,4 +85,4 @@ Replace 'user@example.org' with the user's actual email address, and This will deploy the main and administrative sites to /lwmain and /lwadmin, respectively. * If you need to redeploy the sites later, you need to run - mvn package tomcat:redeploy \ No newline at end of file + mvn package tomcat:redeploy