diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9bea433 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +.DS_Store diff --git a/README.md b/README.md index 073c897..ba7807f 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,8 @@ To test this, use the good old "git clone / dotcloud push" method: git clone git://github.com/mchv/play2-on-dotcloud.git -To deploy your own application, put its code source into application folder - +To deploy your own application, put its code source into application folder or, +Remplace the "application folder" by your "play application folder", and modify the dotcloud.yml (APPLICATION_FOLDER field) Don't forget to do one of the following: - ``dotcloud push`` with the ``--all`` flag (will force the use of rsync over git), diff --git a/dotcloud.yml b/dotcloud.yml old mode 100644 new mode 100755 index f0ead1b..5be0d0a --- a/dotcloud.yml +++ b/dotcloud.yml @@ -1,4 +1,6 @@ play: + environment: + APPLICATION_FOLDER: application type: custom buildscript: playframework/builder ports: diff --git a/playframework/builder b/playframework/builder index d7c21ae..1b8a0bc 100755 --- a/playframework/builder +++ b/playframework/builder @@ -2,7 +2,6 @@ set -e BUILDROOT="$(dirname "$0")" VERSION=2.0.3 - echo 'Checking if Play framework is already installed...' if [ -d ~/play-${VERSION} ] then @@ -29,20 +28,20 @@ else fi echo 'Installing application' -rm -rf ~/application -cp -R ./$SERVICE_APPROOT ~/application +rm -rf ~/$APPLICATION_FOLDER +cp -R ./$SERVICE_APPROOT ~/$APPLICATION_FOLDER echo 'Symlinking application logs to Supervisor area...' -rm -rf ~/application/logs -ln -s /var/log/supervisor ~/application/logs +rm -rf ~/$APPLICATION_FOLDER/logs +ln -s /var/log/supervisor ~/$APPLICATION_FOLDER/logs echo 'Installing run script...' cp "$BUILDROOT/run" ~ echo 'Building the Play application' -cd ~/application +cd ~/$APPLICATION_FOLDER -export _JAVA_OPTIONS="-Xms502m -Xmx502m" +export _JAVA_OPTIONS="-Xms256m -Xmx256m" echo ' -- Cleaning -- ' ~/play-${VERSION}/play clean echo ' -- Compiling -- ' diff --git a/playframework/run b/playframework/run index a156766..6810717 100755 --- a/playframework/run +++ b/playframework/run @@ -1,7 +1,8 @@ #!/bin/sh + export JAVA_OPTIONS="-Xmx128M -XX:PermSize=64M -XX:MaxPermSize=128M" echo "JAVA_OPTIONS=$JAVA_OPTIONS" echo '(To change JAVA_OPTIONS, edit the "run" script!)' -cd ~/application -target/start -Dhttp.port=$PORT_WWW +cd ~/$APPLICATION_FOLDER +target/start -Dconfig.resource=dotcloud.conf -DapplyEvolutions.default=true -Dhttp.port=$PORT_WWW