0

i have setup a distant git repository which trigger a build of my applicatation on the pre-receive hook. my application is made with play framework and build using sbt universal:packageZipTarball i use supervisord to manage processes such as the builded application runner , nginx , ...

i've tryed running the build command in the pre-receive script and directly as a supervisord process but i can't get any output from it and it seems stucked as my application is not builded ...

my supervisord conf file :

sbt-build.conf

[program:sbtbuild]
priority=100
directory=/app/data/build
command=bash sbt-build.sh
user=root
autostart=false
autorestart=false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=2048
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=2048

the build script

sbt-build.sh

#!/bin/bash

set -eu

BUILD_PATH="/app/data/build"
WEBSITE_PATH="/app/data/website"

echo "=> Build application..."
chmod -R +rwx $BUILD_PATH 
cd $BUILD_PATH
sbt universal:packageZipTarball # The script is stuck here...

echo "=> Unpack build..."
cd $BUILD_PATH/target/universal
tar -zxvf *.tgz --strip 1 -C $WEBSITE_PATH 
chmod +x $WEBSITE_PATH

cd $WEBSITE_PATH/bin
rm *.bat
mv * start

echo "=> Run application"
supervisorctl restart sbt

the git hook is working as expected and is setup to triger supervisorctl start sbtbuild last output i get is : Build application... from the echo cmd in sbt-build.sh Also when i run the sbt-build.sh script manually it work as expected

Nils
  • 307
  • 3
  • 10

1 Answers1

0

i finally found the solution here with some explanation.

adding -Djline.terminal=jline.UnsupportedTerminalto the sbt command do the trick.

my start command looks like this now sbt -Djline.terminal=jline.UnsupportedTerminal universal:packageZipTarball

Nils
  • 307
  • 3
  • 10