Logging improved

This commit is contained in:
Juan 2018-04-19 14:05:16 +02:00
parent 0b9b4bcfd0
commit 33c4ba6dbd
5 changed files with 9 additions and 10 deletions

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
vn-repo (2.0.16) stable; urgency=low
vn-repo (2.0.17) stable; urgency=low
* Initial Release.

View File

@ -8,12 +8,10 @@ do
continue
fi
myHost=$(hostname)
repoDir=$(dirname "$0")/..
projectName=$(basename "$(realpath "$repoDir")")
echo "Ref $ref received. It will be deployed automatically."
echo "Host $myHost"
echo "$projectName" "master" > /tmp/vn-repo.changes
#nohup sudo -u vn-repo "vn-branch $projectName" &> /dev/null &

View File

@ -12,10 +12,11 @@ logFile="/var/cache/reprepro/logs/$projectName.out"
rm -f "$logFile"
echo -e "\n# Deploying started.\n" >> "$logFile"
echo -e "\n# Deploying started\n" >> "$logFile"
echo " * Date: $(date)" >> "$logFile"
echo " * Project: $projectName" >> "$logFile"
echo " * Directory: $srcDir" >> "$logFile"
echo " * Host: $(hostname)" >> "$logFile"
mkdir -p "$srcDir"
git --work-tree="$srcDir" --git-dir="$repoDir" checkout -f
@ -25,4 +26,4 @@ then
(cd "$srcDir" && "$srcDir/deploy" >> "$logFile" 2>&1)
fi
echo -e "\n# Deploying ended.\n" >> "$logFile"
echo -e "\n# Deploying ended\n" >> "$logFile"

View File

@ -13,22 +13,22 @@ codename="stable"
if [ -f "$srcDir/package.json" ]
then
echo -e "\n# Installing Node dependencies.\n"
echo -e "\n# Installing Node dependencies\n"
(cd "$srcDir" && npm --silent install)
fi
if [ -f "$srcDir/debian/changelog" ]
then
echo -e "\n# Cleaning last build.\n"
echo -e "\n# Cleaning last build\n"
rm -f $buildDir/*.deb
rm -f $buildDir/*.changes
rm -f $buildDir/*.build
(cd "$srcDir" && debian/rules clean)
echo -e "\n# Building Debian packages.\n"
echo -e "\n# Building Debian packages\n"
(cd "$srcDir" && debuild -uc -us -b)
echo -e "\n# Adding packages to repository.\n"
echo -e "\n# Adding packages to repository\n"
cut -d" " -f1 "$srcDir/debian/files" |
while read debFile

View File

@ -25,7 +25,7 @@ fi
# FIXME: Packages are not upgraded when config files are changed
echo -e "\n# Upgrading servers.\n"
echo -e "\n# Upgrading servers\n"
for host in $hosts
do