Mercurial > lada > lada-server
diff wildfly/execute.sh @ 748:75e87b7d37c0
Add dockerised setup for running the server.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Tue, 27 Oct 2015 18:38:54 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wildfly/execute.sh Tue Oct 27 18:38:54 2015 +0100 @@ -0,0 +1,39 @@ +#!/bin/bash + +if [ -z $JBOSS_HOME ] +then + JBOSS_HOME=/opt/jboss/wildfly +fi +JBOSS_CLI=$JBOSS_HOME/bin/jboss-cli.sh +JBOSS_MODE=${1:-"standalone"} +JBOSS_CONFIG=${2:-"$JBOSS_MODE.xml"} + +function wait_for_server() { + until `$JBOSS_CLI -c "ls /deployment" &> /dev/stdout`; do + sleep 1 + done +} + +function wait_for_shutdown() { + until `$JBOSS_CLI -c "ls /deployment" &> /dev/stdout`; do + sleep 1 + done +} + +echo "=> Starting WildFly server" +$JBOSS_HOME/bin/$JBOSS_MODE.sh -c $JBOSS_CONFIG & + +echo "=> Waiting for the server to boot" +wait_for_server + +echo "=> Executing the commands" +$JBOSS_CLI -c --user=admin --password=secret --file=`dirname "$0"`/commands.cli + +echo "=> Shutting down WildFly" +if [ "$JBOSS_MODE" = "standalone" ]; then + $JBOSS_CLI -c ":shutdown" + sleep 10 + echo "=> done." +else + $JBOSS_CLI -c "/host=*:shutdown" +fi