Skip to content

Commit

Permalink
Adds a script, deployed to /usr/bin, that can be run to start the tes…
Browse files Browse the repository at this point in the history
…t service.
  • Loading branch information
schwink committed Aug 9, 2010
1 parent 4d7b6b6 commit c55a29c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/dev/Makefile
@@ -1,6 +1,7 @@
NAME = kanaloa-dev
VERSION = 0.01
NGINX_SITES_AVAILABLE=$(DESTDIR)/etc/nginx/sites-available
DEST_BIN = $(DESTDIR)/usr/bin

build:
/bin/true
Expand All @@ -11,8 +12,10 @@ clean:
force:

install:
@mkdir -p $(NGINX_SITES_AVAILABLE)
cp config/nginx/kanaloa $(NGINX_SITES_AVAILABLE)/
@mkdir -p $(NGINX_SITES_AVAILABLE) || true
cp config/nginx/kanaloa $(NGINX_SITES_AVAILABLE)/ || true
@mkdir -p $(DEST_BIN) || true
cp bin/kanaloa_test_app $(DEST_BIN)

package: force
# Increment the version number
Expand Down
49 changes: 49 additions & 0 deletions server/dev/bin/kanaloa_test_app
@@ -0,0 +1,49 @@
#!/bin/bash

set -e
#set -x

die () {
echo >&2 "usage: kanaloa_test_app -n sname -p portNum [-d]"
exit 1
}

ARGS=""
PERSIST="false"
while getopts "n:p:ds" flag
do
#echo "$flag" $OPTIND $OPTARG
case $flag in
"n")
SNAME=$OPTARG
;;

"p")
[[ $OPTARG != *[^0-9]* ]] || die
PORTNUM=$OPTARG
;;

"d")
ARGS="-detached -noinput"
;;

*)
die
esac
done

[[ $SNAME != "" ]] || die
[[ $PORTNUM != "" ]] || die

# Set up the HOME environment variable, which erl expects
# CHANGE THIS TO YOUR CODE DIRECTORY
RUNDIR=/home/dev/code/kanaloa/server/kanaloa/
export HOME=$RUNDIR

cd $RUNDIR
exec erl \
-pa $RUNDIR/tbin/ \
-sname $SNAME \
-boot start_sasl -s reloader -s test_app \
-test_app port $PORTNUM \
+K true +P 100000 $ARGS

0 comments on commit c55a29c

Please sign in to comment.