I want to trigger the jenkins build in post-commit hook.if file is committed on directory "SOURCE/databasescript" and file name is "update.sql".
post-commit
set "REPOS=%~1"
set "TXN=%~3"
set "REV=%~2"
echo "repos %REPOS%." >> C:\test.log
echo "REV %REV%." >> C:\test.log
echo "txn %TXN%." >> C:\test.log
"%VISUALSVN_SERVER%\bin\svnlook.exe" changed -r %2 %1 >>C:\test.log
Output
"repos D:\Repositories\TestNAPFServer."
"REV 82."
"txn 81-2e."
U SOURCE/databasescript/basedb.sql
U SOURCE/databasescript/update.sql
I do not know how to write condition to find the filename in directory list in batch file.Please suggest.
Below solution work for me:
Post-commit.cmd
post-commit-hook-jenkins-sam.vbs