I'm trying to make a rails controller pull the latest content from a repo on bit bucket. To the most part this is a success the only issue I have whilst testing I can only seem to get the page to output the first line the script returns and that seems to not run the rest of the script any ideas
Here is my bash script
#!/bin/bash -l
GIT_REPO='IMAREPO'
TMP_GIT_CLONE=TEMPPATH
PUBLIC_WWW=SITEPATH
if [ -d $TMP_GIT_CLONE ]; then
rm -Rf $TMP_GIT_CLONE
fi
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build --source $TMP_GIT_CLONE --destination $PUBLIC_WWW
rm -Rf $TMP_GIT_CLONE
exit
and in the rails controller I am doing
@result = %x[/var/srv/pulldevelopment.sh]
Which in turn only out put a single line from the script which is
Cloning into '/root/tmp/git/blah'...
Yes, this is expected. By default Git only prints progress status if stderr is connected to a TTY. You can reproduce this behavior in a terminal with:
Pass
--progress
to always get progress status on the stderr stream. See git-clone(1).