1. 配置RTX服务器IP限制,修改RTX服务器端的文件SDKProperty.xml,如下:
<?xml version="1.0"?>
<Property>
<APIClient>
<IPLimit Enabled="1">
<IP>127.0.0.1</IP>
</IPLimit>
</APIClient>
<sdkhttp>
<IPLimit Enabled="1">
</IPLimit>
</sdkhttp>
</Property>
默认的情况下,IP是限制的,只允许本机调用SDK。如果打开IP限制,如:允许 192.168.20.2能够调用SDK,配置如下:
<?xml version="1.0"?>
<Property>
<APIClient>
<IPLimit Enabled="0">
<IP>127.0.0.1</IP>
<IP>192.168.20.2</IP>
</IPLimit>
</APIClient>
<sdkhttp>
<IPLimit Enabled="0">
</IPLimit>
</sdkhttp>
</Property>
配置完成后重新启动RTX所有服务器,
然后验证:在IP为192.168.20.2机器的IE地址栏里输入如下字符串:
http://192.168.20.60:8012/sendnotify.cgi?msg=hello&receiver=[RTX帐号或数字号码]
2.修改SVN服务器hooks目录下的勾子文件,比如提交后调用(我这里是版本库目录“测试提交单”下,有角色操作后则向RTX1005和1006的角色发送消息)
@echo off
for /f "delims=" %%a in ('svnlook dirs-changed "F:\Repositories\rep2"') do (
for /f "delims=" %%b in ('svnlook author "F:\Repositories\rep2"') do (
if "%%a"=="branches/test1/测试提交单/" (if "%%b"=="tester" (goto Alert2) else (goto Alert1)) else (goto Alert0)
)
)
:Alert0
exit 0
:Alert1
mshta vbscript:CreateObject("WScript.Shell").Run("iexplore http://192.168.20.41:8012/sendnotify.cgi?receiver=1005,1006&msg=%DATE% %TIME% 提示:有新的测试提交单 版本:%2",0)(window.close)
ping 127.1 -n 3 >nul && taskkill /f /im iexplore.exe
exit 0
:Alert2
mshta vbscript:CreateObject("WScript.Shell").Run("iexplore http://192.168.20.41:8012/sendnotify.cgi?receiver=1005,1006&msg=%DATE% %TIME% 提示:更新完毕 版本:%2",0)(window.close)
ping 127.1 -n 3 >nul && taskkill /f /im iexplore.exe
exit 0