I'm trying to deploy a Playframework 2.0 application on dotCloud using a "custom type" script" from play2-on-dotcloud.
My dotcloud.yml
looks like this:
play:
type: custom
buildscript: dotcloud/builder
ports:
www: http
process: ~/run
approot: .
My dotcloud/builder
script:
#!/bin/bash
set -e
BUILDROOT="$(dirname "$0")"
VERSION=2.0.2
echo 'Checking if Play framework is already installed...'
if [ -d ~/play-${VERSION} ]
then
echo 'Play framework found.'
else
echo 'Play framework not found. Installing it...'
echo '- Download Play framework'
curl -O http://download.playframework.org/releases/play-${VERSION}.zip
if [ -e play-${VERSION}.zip ]
then
echo '- Unzip downloaded file'
unzip -q play-${VERSION}.zip
if [ -d play-${VERSION} ]
then
echo '- Copy play installation'
cp -R ./play-${VERSION} ~/play-${VERSION}
echo 'Play installed.'
else
echo 'Unzip failed !'
fi
else
echo 'Download failed !'
fi
fi
echo 'Installing application'
rm -rf ~/application
cp -R ./$SERVICE_APPROOT ~/application
echo 'Symlinking application logs to Supervisor area...'
rm -rf ~/application/logs
ln -s /var/log/supervisor ~/application/logs
echo 'Installing run script...'
cp "$BUILDROOT/run" ~
echo 'Building the Play application'
cd ~/application
echo ' -- Cleaning -- '
~/play-${VERSION}/play clean
echo ' -- Compiling -- '
~/play-${VERSION}/play compile
echo ' -- Staging -- '
~/play-${VERSION}/play stage
echo 'Build complete.'
But when I make a dotcloud push myapp
, it fails randomly with the following message:
09:44:26 [play] Killed
-- Build failed: "SERVICE_POSTINSTALL='' SERVICE_APPROOT=. SERVICE_REQUIREMENTS='[]' SERVICE_BUILDSCRIPT=dotcloud/builder SERVICE_TYPE=custom SERVICE_PORTS_WWW=http SERVICE_PROCESS='~/run' ./dotcloud/builder" failed with return code 137
09:44:27 ---> Aborting due to some build failure
Either it fails at the beginning of the script, either not far from the end (compile time). But it fails every time with the same error message.
Also note that I was able to deploy a previous Play app on dotCloud (but a smaller one).
I tried for about 15 times, and I couldn't deploy my app :(
Is there any timeout with bob-the-builder ?
UPDATE:
Made more tests, and finally trying to build the app by login into the dotcloud server using ssh. When, I run play compile
, it constantly fails on dependency resolution, it tries to solve dependencies, and them "something" kills the build process:
dotcloud@xxxxx-default-play-0:~/application$ play compile
[info] Loading project definition from /home/dotcloud/application/project
[info] Set current project to xxxxx (in build file:/home/dotcloud/application/
[info] Compiling 26 Scala sources and 10 Java sources to /home/dotcloud/application/modules/securesocial/target/scala-2.9.1/classes...
[info] Updating {file:/home/dotcloud/application/}xxxxx...
Killed Resolving play#play-test_2.9.1;2.0.2 ...