Build system and documentation update
* Added tests of the command line tools to the post-build scripts * Local deployment documentation mentions ImportResources
This commit is contained in:
parent
fd117f6f7b
commit
cb2553d1e5
3 changed files with 52 additions and 1 deletions
0
build/post-build.sh → build/post-build.d/10-database-tests.sh
Executable file → Normal file
0
build/post-build.sh → build/post-build.d/10-database-tests.sh
Executable file → Normal file
49
build/post-build.d/20-import-tools.sh
Normal file
49
build/post-build.d/20-import-tools.sh
Normal file
|
@ -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 <<EOF
|
||||
admin=$USER
|
||||
db=tests
|
||||
user=tests
|
||||
password=tests
|
||||
EOF
|
||||
psql -vQUIET=1 -vON_ERROR_STOP=1 -e --file database.sql || exit 1
|
||||
cd ..
|
||||
|
||||
cat > data-source.xml <<EOF
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||
|
||||
<bean name="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="org.postgresql.Driver" />
|
||||
<property name="url" value="jdbc:postgresql:tests" />
|
||||
<property name="username" value="tests" />
|
||||
<property name="password" value="tests" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
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
|
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue