Test
This commit is contained in:
parent
4e554cbce7
commit
b9cf0cd1b4
|
@ -1,4 +1,4 @@
|
|||
vn-repo (2.0.37) stable; urgency=low
|
||||
vn-repo (2.0.38) stable; urgency=low
|
||||
|
||||
* Initial Release.
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
vn-repo.conf etc/apache2/conf-available
|
||||
config etc/vn-repo
|
||||
git-hooks usr/share/vn-repo
|
||||
web usr/share/vn-repo
|
||||
vn-branch usr/bin
|
||||
|
|
22
vn-branch
22
vn-branch
|
@ -6,6 +6,17 @@ if [ "$#" -eq "0" ]; then
|
|||
fi
|
||||
|
||||
projectName=$1
|
||||
gitBranch=$2
|
||||
|
||||
. /etc/vn-repo/config
|
||||
|
||||
if [ -z "$gitUrl" ]; then
|
||||
gitUrl=http://localhost
|
||||
fi
|
||||
if [ -z "$gitBranch" ]; then
|
||||
gitBranch=master
|
||||
fi
|
||||
|
||||
repoDir="/var/lib/git/$projectName"
|
||||
srcDir="/tmp/vn-repo/$projectName/src"
|
||||
logDir="/usr/share/vn-repo/web/logs"
|
||||
|
@ -21,10 +32,17 @@ echo " * Directory: $srcDir" >> "$logFile"
|
|||
echo " * Host: $(hostname)" >> "$logFile"
|
||||
|
||||
mkdir -p "$srcDir"
|
||||
git --work-tree="$srcDir" --git-dir="$repoDir" checkout -f
|
||||
cd "$srcDir"
|
||||
|
||||
if [ ! -d "$srcDir/.git" ]; then
|
||||
git init
|
||||
fi
|
||||
|
||||
git config remote.origin.url "$gitUrl/$projectName"
|
||||
git pull origin "$gitBranch"
|
||||
|
||||
if [ -f "$srcDir/deploy" ]; then
|
||||
(cd "$srcDir" && "$srcDir/deploy" >> "$logFile" 2>&1)
|
||||
"$srcDir/deploy" >> "$logFile" 2>&1
|
||||
fi
|
||||
|
||||
echo -e "\n# Deploying ended\n" >> "$logFile"
|
||||
|
|
Reference in New Issue