@echo off
set execpath=%cd%
set zipName=nba_res.zip
set execzip=D:/jenkinsworkspace/build/zip/zip.exe
set csv_remote=svn://47.101.203.92/trunk/10conf/program/exe/CSV.js
set remote=root@47.101.203.92
set remote_root=/data/web/nba
set local_root=./
set hash_path=banshu
set "zipdir=./zipfile"
call ssh %remote% "cd %remote_root%;sh /data/soft/shell/hash.sh %remote_root%/%hash_path%"
echo scp %remote%:%remote_root%/%hash_path%.hash %local_root%%hash_path%
call scp %remote%:%remote_root%/%hash_path%.hash %local_root%

svn export %csv_remote%
node ./CSV.js --folder_update %local_root%%hash_path%
del /q CSV.js
del /q banshu.hash
@echo off


if exist "%zipdir%" (
	cd zipfile
	call %execzip% -r ..\%zipName% .\%hash_path%
	call scp -r ../%zipName% root@10.0.1.112:/data/web/nba/
	call ssh root@10.0.1.112 "cd /data/web/nba;unzip -o %zipName%;rm -fr %zipName%"
	cd ..
	rmdir /s/q "%zipdir%"
) else (
    echo 没有需要更新的文件
)
pause


