Mercurial > lada > lada-server
comparison 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 |
comparison
equal
deleted
inserted
replaced
747:214508fd95e7 | 748:75e87b7d37c0 |
---|---|
1 #!/bin/bash | |
2 | |
3 if [ -z $JBOSS_HOME ] | |
4 then | |
5 JBOSS_HOME=/opt/jboss/wildfly | |
6 fi | |
7 JBOSS_CLI=$JBOSS_HOME/bin/jboss-cli.sh | |
8 JBOSS_MODE=${1:-"standalone"} | |
9 JBOSS_CONFIG=${2:-"$JBOSS_MODE.xml"} | |
10 | |
11 function wait_for_server() { | |
12 until `$JBOSS_CLI -c "ls /deployment" &> /dev/stdout`; do | |
13 sleep 1 | |
14 done | |
15 } | |
16 | |
17 function wait_for_shutdown() { | |
18 until `$JBOSS_CLI -c "ls /deployment" &> /dev/stdout`; do | |
19 sleep 1 | |
20 done | |
21 } | |
22 | |
23 echo "=> Starting WildFly server" | |
24 $JBOSS_HOME/bin/$JBOSS_MODE.sh -c $JBOSS_CONFIG & | |
25 | |
26 echo "=> Waiting for the server to boot" | |
27 wait_for_server | |
28 | |
29 echo "=> Executing the commands" | |
30 $JBOSS_CLI -c --user=admin --password=secret --file=`dirname "$0"`/commands.cli | |
31 | |
32 echo "=> Shutting down WildFly" | |
33 if [ "$JBOSS_MODE" = "standalone" ]; then | |
34 $JBOSS_CLI -c ":shutdown" | |
35 sleep 10 | |
36 echo "=> done." | |
37 else | |
38 $JBOSS_CLI -c "/host=*:shutdown" | |
39 fi |