Skip to content

Instantly share code, notes, and snippets.

@gupta-himanshu
Created April 8, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gupta-himanshu/628fb98c68b0fabc1fd64dacc66a3f93 to your computer and use it in GitHub Desktop.
Save gupta-himanshu/628fb98c68b0fabc1fd64dacc66a3f93 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
echo "Going to App directory"
APP_DIR=/path/to/lagom-service
cd $APP_DIR
echo "Building Lagom dist"
sbt "project lagom-impl" "clean" "dist"
APP_UNIVERSAL=$APP_DIR/lagom-service/lagom-impl/target/universal
rm -rf $APP_UNIVERSAL/lagom-impl-0.1-SNAPSHOT
unzip $APP_UNIVERSAL/lagom-impl-0.1-SNAPSHOT.zip -d $APP_UNIVERSAL
echo "Setting configurations"
APP_LIB=$APP_UNIVERSAL/lagom-impl-0.1-SNAPSHOT/lib
APP_CLASSPATH=$APP_LIB/*
JAVA_OPTS=""
JMX_CONFIG=""
PLAY_SECRET=none
CONFIG_FILE=/path/to/application.conf
CONFIG="-Dplay.crypto.secret=$PLAY_SECRET -Dlagom.cluster.join-self=off -Dorg.xerial.snappy.use.systemlib=true -Dconfig.file=$CONFIG_FILE"
PLAY_SERVER_START="play.core.server.ProdServerStart"
exec java -cp "$APP_CLASSPATH" $JAVA_OPTS $JMX_CONFIG $CONFIG $PLAY_SERVER_START
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment