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.
|
* Initial Release.
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
vn-repo.conf etc/apache2/conf-available
|
vn-repo.conf etc/apache2/conf-available
|
||||||
|
config etc/vn-repo
|
||||||
git-hooks usr/share/vn-repo
|
git-hooks usr/share/vn-repo
|
||||||
web usr/share/vn-repo
|
web usr/share/vn-repo
|
||||||
vn-branch usr/bin
|
vn-branch usr/bin
|
||||||
|
|
22
vn-branch
22
vn-branch
|
@ -6,6 +6,17 @@ if [ "$#" -eq "0" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
projectName=$1
|
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"
|
repoDir="/var/lib/git/$projectName"
|
||||||
srcDir="/tmp/vn-repo/$projectName/src"
|
srcDir="/tmp/vn-repo/$projectName/src"
|
||||||
logDir="/usr/share/vn-repo/web/logs"
|
logDir="/usr/share/vn-repo/web/logs"
|
||||||
|
@ -21,10 +32,17 @@ echo " * Directory: $srcDir" >> "$logFile"
|
||||||
echo " * Host: $(hostname)" >> "$logFile"
|
echo " * Host: $(hostname)" >> "$logFile"
|
||||||
|
|
||||||
mkdir -p "$srcDir"
|
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
|
if [ -f "$srcDir/deploy" ]; then
|
||||||
(cd "$srcDir" && "$srcDir/deploy" >> "$logFile" 2>&1)
|
"$srcDir/deploy" >> "$logFile" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e "\n# Deploying ended\n" >> "$logFile"
|
echo -e "\n# Deploying ended\n" >> "$logFile"
|
||||||
|
|
Reference in New Issue