summaryrefslogtreecommitdiff
path: root/hooks/post-receive
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-10-22 21:07:55 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2013-10-22 21:08:06 +0200
commit5821a949035a5e098a2c6b395818f5efa1c66f8e (patch)
treed422930b63ce2ed2a0276869173b2b9996fd6bfc /hooks/post-receive
parentb48cb3ff989c7c8ad89f04c8eda5a0e8cf091bf7 (diff)
downloadappstore-5821a949035a5e098a2c6b395818f5efa1c66f8e.tar.gz
appstore-5821a949035a5e098a2c6b395818f5efa1c66f8e.tar.bz2
appstore-5821a949035a5e098a2c6b395818f5efa1c66f8e.tar.xz
appstore-5821a949035a5e098a2c6b395818f5efa1c66f8e.zip
wip
Diffstat (limited to 'hooks/post-receive')
-rwxr-xr-xhooks/post-receive27
1 files changed, 21 insertions, 6 deletions
diff --git a/hooks/post-receive b/hooks/post-receive
index a2835de..e0375c3 100755
--- a/hooks/post-receive
+++ b/hooks/post-receive
@@ -23,9 +23,12 @@ IFS=$'\t'
csvtool -u TAB namedcol dir,resolver,resolver_args,version,state apps.csv | \
while read dir resolver resolver_args version state
do
+ cd "$APPS"
+
if [ -d "$dir" ]
then
- cd $dir
+ cd "$dir"
+ dir=`pwd`
old_version=$(app conf get app.version)
if [[ $new_version == $old_version ]]
@@ -36,20 +39,32 @@ do
echo "Updating $dir to $version"
app conf set app.version "$version"
app update
- cd ..
else
echo "New application: $dir"
app init -d "$dir" "$resolver" "$resolver_args"
+ cd "$dir"
+ dir=`pwd`
fi
cd "$dir"
if [[ $state == enabled ]]
then
- echo "Starting appliation"
- app start
+ cmd=start
+ title="Starting"
else
- echo "Stopping appliation"
- app stop
+ cmd=stop
+ title="Stopping"
+ fi
+
+ echo "$title appliation"
+ set +e
+ app $cmd
+ ret=$?
+ set -e
+
+ if [[ $ret != 0 ]]
+ then
+ echo "$cmd command failed."
fi
done
unset IFS