Stuck at SSH while post-commit on SVN -
i'm trying setup svn export files existing server.
because company server live , huge has been operating several years, cannot wipe
whole webserver , svn update
server files big , content custom file.
what want commit
on server , scp
latest committed file server b, file in web server direction. have attempt following below fail, better way recommend me? i'm not on doing configuration.
here i'm attempt on post-commit:
repository="file:///var/www/html/svn/testrepo/" revision_from=$2 target_directory="/home/svn/" expr $((revision_from--)) rm -r -f $target_directory line in `svn diff --summarize -r $revision_from:head $repository | grep "^[am]"` if [ $line != "a" ] && [ $line != "am" ] && [ $line != "m" ]; filename=`echo "$line" |sed "s|$repository||g"` # don't export if it's directory we've created if [ ! -d $target_directory$filename ]; directory=`dirname $filename` mkdir -p $target_directory$directory svn export --force $line $target_directory$filename fi fi done scp -r -p 1221 /home/svn/* svnadmin@192.168.0.1:/home/svnadmin/ ssh -t -t -p 1221 svnadmin@192.168.0.1 \ sudo -u apache /bin/cp -rf /home/svnadmin/* /path/to/web/
please let me know if need info~
edit: modify script latest
edit2: got error , doesn't seems execute /bin/cp
post-commit hook failed (exit code 1) output: tcgetattr: inappropriate ioctl device connection 192.168.0.1 closed.
solved adding user apache group, user can overwrite apache files
Comments
Post a Comment