diff --git a/debian/changelog b/debian/changelog
index b15fd4b..8d83f4c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-vn-repo (2.0.20) stable; urgency=low
+vn-repo (2.0.21) stable; urgency=low
* Initial Release.
diff --git a/debian/control b/debian/control
index ed20fb4..c45335a 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Vcs-Git: https://git.verdnatura.es/vn-repo
Package: vn-repo
Architecture: all
Depends: reprepro, git, sudo, devscripts
-Suggests: apache2 | httpd, git, gitweb, gitweb-theme, nodejs
+Suggests: apache2 | httpd, git, gitweb, gitweb-theme, nodejs, vn-host
Section: vcs
Priority: optional
Description: Helper to set up a repository
diff --git a/debian/install b/debian/install
index bed4e9c..7d39cfd 100644
--- a/debian/install
+++ b/debian/install
@@ -1,5 +1,6 @@
vn-repo.conf etc/apache2/conf-available
-git-hooks/post-receive usr/bin
+git-hooks usr/share/vn-repo
+web usr/share/vn-repo
vn-branch usr/bin
vn-deploy usr/bin
vn-debuild usr/bin
diff --git a/debian/postrm b/debian/postrm
index 33c0ccb..4d056b1 100755
--- a/debian/postrm
+++ b/debian/postrm
@@ -3,7 +3,7 @@ set -e
# Removes the repository user
-# FIXME: This package cannot upgrade itself because user is logged in
+# FIXME: This package cannot deploy itself because user is logged in
#userdel vn-repo
# Enables Apache configuration
diff --git a/deploy b/deploy
index 25af650..7dae519 100755
--- a/deploy
+++ b/deploy
@@ -2,4 +2,4 @@
set -e
vn-debuild
-vn-deploy www1.static www2.static
+vn-deploy root@www1.static root@www2.static
diff --git a/git-hooks/post-receive b/git-hooks/post-receive
index 7e93c92..b19c322 100755
--- a/git-hooks/post-receive
+++ b/git-hooks/post-receive
@@ -3,8 +3,7 @@ set -e
while read oldrev newrev ref
do
- if [[ ! $ref =~ .*/master$ ]]
- then
+ if [[ ! $ref =~ .*/master$ ]]; then
continue
fi
diff --git a/vn-branch b/vn-branch
index d9b5080..3b0f034 100755
--- a/vn-branch
+++ b/vn-branch
@@ -8,8 +8,10 @@ fi
projectName=$1
repoDir="/var/lib/git/$projectName"
srcDir="/tmp/vn-repo/$projectName/src"
-logFile="/var/cache/reprepro/logs/$projectName.out"
+logDir="$HOME/logs"
+logFile="$logDir/$projectName.out"
+mkdir -p "$logDir"
rm -f "$logFile"
echo -e "\n# Deploying started\n" >> "$logFile"
@@ -21,8 +23,7 @@ echo " * Host: $(hostname)" >> "$logFile"
mkdir -p "$srcDir"
git --work-tree="$srcDir" --git-dir="$repoDir" checkout -f
-if [ -f "$srcDir/deploy" ]
-then
+if [ -f "$srcDir/deploy" ]; then
(cd "$srcDir" && "$srcDir/deploy" >> "$logFile" 2>&1)
fi
diff --git a/vn-debuild b/vn-debuild
index 78a691d..f55e216 100755
--- a/vn-debuild
+++ b/vn-debuild
@@ -11,14 +11,12 @@ buildDir="$srcDir/.."
repreproDir="/var/cache/reprepro"
codename="stable"
-if [ -f "$srcDir/package.json" ]
-then
+if [ -f "$srcDir/package.json" ]; then
echo -e "\n# Installing Node dependencies\n"
(cd "$srcDir" && npm --silent install)
fi
-if [ -f "$srcDir/debian/changelog" ]
-then
+if [ -f "$srcDir/debian/changelog" ]; then
echo -e "\n# Cleaning last build\n"
rm -f $buildDir/*.deb
rm -f $buildDir/*.changes
@@ -31,10 +29,8 @@ then
echo -e "\n# Adding packages to repository\n"
cut -d" " -f1 "$srcDir/debian/files" |
- while read debFile
- do
- if [[ ! "$debFile" =~ .*\.deb$ ]]
- then
+ while read debFile; do
+ if [[ ! "$debFile" =~ .*\.deb$ ]]; then
continue
fi
diff --git a/vn-deploy b/vn-deploy
index e7e6e54..bb2ff6b 100755
--- a/vn-deploy
+++ b/vn-deploy
@@ -3,22 +3,19 @@ set -e
hosts="$@"
-if [ -z "$hosts" ]
-then
- echo "Usage: $(basename $0) host1 [host2]..."
+if [ -z "$hosts" ]; then
+ echo "Usage: $(basename $0) [user1@]host1 [[user2@]host2]..."
exit 1
fi
packages=""
-while read -r line
-do
+while read -r line; do
packageName=$(echo $line | cut -d"_" -f1)
packages="$packages $packageName"
done < "$PWD/debian/files"
-if [ -z "$packages" ]
-then
+if [ -z "$packages" ]; then
echo "No packages found to install."
exit 1
fi
@@ -27,8 +24,7 @@ fi
echo -e "\n# Upgrading servers\n"
-for host in $hosts
-do
+for host in $hosts; do
echo " * Upgrading $host"
- ssh root@$host "update-repo vn && apt-get install $packages"
+ ssh $host "update-repo vn && apt-get --quiet --yes install $packages"
done
diff --git a/vn-rcheck b/vn-rcheck
index 264352f..954161f 100755
--- a/vn-rcheck
+++ b/vn-rcheck
@@ -6,10 +6,8 @@ changesFile="/tmp/vn-repo.changes"
(
flock -n 200 || exit
- if [ -f "$changesFile" ]
- then
- while read -r line
- do
+ if [ -f "$changesFile" ]; then
+ while read -r line; do
projectName=$(echo $line | cut -d" " -f1)
branch=$(echo $line | cut -d" " -f2)
diff --git a/vn-repo.conf b/vn-repo.conf
index c58c159..6fb4de4 100644
--- a/vn-repo.conf
+++ b/vn-repo.conf
@@ -1,4 +1,5 @@
#Alias /apt /var/cache/reprepro/
+#Alias /repo /var/cache/vn-repo/web/