Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
add script to run liquibase with suitable classpath
  • Loading branch information
seanf committed May 11, 2011
1 parent 4e2584e commit 54fdde4
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions server/zanata-war/src/main/webapp/WEB-INF/liquibase
@@ -0,0 +1,43 @@
#!/bin/bash

# convenience script to run liquibase with suitable Zanata settings
# see http://liquibase.org/manual/command_line

SCRIPT_PATH=`dirname ${BASH_SOURCE[0]}`
war=$SCRIPT_PATH/..

if [ -z $JBOSS_HOME ]; then
echo "Error: JBOSS_HOME not set. For instance: export JBOSS_HOME=/opt/jboss-ewp-5.0/jboss-as-web"
exit 1
fi

classpath=\
$(echo $war/WEB-INF/lib/*.jar \
$war/WEB-INF/classes/ \
$JBOSS_HOME/server/default/lib/mysql-connector-java*.jar \
$JBOSS_HOME/lib/log4j-boot.jar | sed 's/ /:/g')

if [ -r liquibase.properties ]; then
defs=
else
defs=--defaultsFile=$HOME/.config/liquibase.properties
fi

java \
-jar $war/WEB-INF/lib/liquibase-core*.jar \
--classpath $classpath \
--changeLogFile=db/db.changelog.xml \
$defs \
"$@"

exit 0




sample of liquibase.properties (put in $HOME/.config/, or current dir):

driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/zanata?characterEncoding=UTF-8
username=root
password=rootpassword

0 comments on commit 54fdde4

Please sign in to comment.