22 lines
383 B
Plaintext
22 lines
383 B
Plaintext
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
if [ "$#" -eq "0" ]; then
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
projectName=$1
|
||
|
repoDir="/var/lib/git/$projectName"
|
||
|
srcDir="/tmp/vn-repo/$projectName/src"
|
||
|
logFile="/var/cache/reprepro/logs/$projectName.out"
|
||
|
|
||
|
rm -f "$logFile"
|
||
|
|
||
|
mkdir -p "$srcDir"
|
||
|
git --work-tree="$srcDir" --git-dir="$repoDir" checkout -f
|
||
|
|
||
|
if [ -f "$srcDir/deploy" ]
|
||
|
then
|
||
|
(cd "$srcDir" && "$srcDir/deploy" >> "$logFile")
|
||
|
fi
|