我做了一段批处理代码,我认为这会起作用。我在想这段代码在做什么?我有一些插件,我想测试部署是否正确。所以我从 plugins.txt 中得到了 pluginlink。然后我用 java 语句从 SVN 获取插件。我部署插件并在 test1.txt 中获得反馈。然后我在该文件中执行 findStr 并搜索“BUILD SUCCESSFUL”,如果它在那里我想添加句子 Build Gelukt,如果它失败我想添加 Build Fout。但我总是得到 Build Gelukt 的答案,而正如您在图像中看到的那样,他发回的构建失败。
这段代码有什么问题?
for /f "tokens=* delims= " %%a in (plugins.txt) do (
echo %%a
cd "C:\dotCMS Automatic Install"
java -cp .;"C:\dotCMS Automatic Install\svnkit.jar" Test %%a
cd %dotcms_home%
call ant deploy-plugins > test1.txt
FindStr "SUCCESSFUL" test1.txt
if %ERRORLEVEL% ==1 (echo ^<tr BGCOLOR=\"#FFFFFF\"^>^<td^>%%a^</td^>^<td^>Build Fout^</td^>^</tr^> >> C:\dotCMSResults\goedje.html ) else (echo ^<tr BGCOLOR=\"#00FF00\"^>^<td^>%%a^</td^>^<td^>Build Gelukt^</td^>^</tr^> >> C:\dotCMSResults\goedje.html)
del test1.txt
rem call ant undeploy-plugins >> test.txt
)