REM @echo off REM call c:\bin\cipres.bat setlocal set HOME=%HOMEDRIVE%%HOMEPATH% set PLATFORM=win32x86 set USER=phoover set WEBSERVER=myfiles.sdsc.edu set WEBDIR=/misc/www/projects/TOL/dev_snapshot set WEBDIR_M=/misc/www/projects/TOL/software/maintainer set WEBDIR_SDK=/misc/www/projects/TOL/software/SDK set CIPRES_VERSION=1.0.1 set BUILD_LOG_NAME=Build-Win32.log call dobuild > %BUILD_LOG_NAME% 2>&1 if errorlevel 1 set BUILDERROR=true :DEBUG_Continue set REVISION=UNKNOWN for /F "usebackq delims==" %%i in (`svn info cipres ^| sed 's/Revision\: //' ^| sed /'^^[a-zA-Z]'/d `) do set REVISION=%%i set BUILD_PREFIX=%PLATFORM%-cipres-%CIPRES_VERSION%-r set BUILD_ID=%BUILD_PREFIX%%REVISION% set BUILD_ID_PATTERN=%BUILD_PREFIX%* set LOGFILE=%BUILD_ID%-build-log.txt set RESULTSDIR=%BUILD_ID%-test-report set DIST_NAME=CIPRES-v%CIPRES_VERSION%-r%REVISION%-%PLATFORM% :MakeBinDist if "%BUILDERROR%" == "true" goto Error rd /S /Q %BUILD_ID% mkdir %BUILD_ID% move cipres\build %BUILD_ID%\CIPRES-ROOT set ORIG_DIR=%CD% cd %BUILD_ID%\CIPRES-ROOT\share\cipres\resources del /s configure.properties cd %ORIG_DIR% jar cMf %BUILD_ID%.zip %BUILD_ID% :MakeMaintainerDist if "%BUILDERROR%" == "true" goto Error copy /Y cipres\cipres-build-scripts\build-for-windows\configureTools.bat maintainer-dist\CIPRES-and-deps copy /Y cipres\cipres-build-scripts\build-for-windows\findCipres.py maintainer-dist\CIPRES-and-deps copy /Y cipres\cipres-build-scripts\build-for-windows\readme.txt maintainer-dist\CIPRES-and-deps set ORIG_DIR=%CD% cd maintainer-dist jar cMf CIPRES-deps-win32.zip CIPRES-and-deps cd %ORIG_DIR% :MakeExternalDist if "%BUILDERROR%" == "true" goto Error echo %REVISION% > svnRevision_win.txt set ORIG_DIR=%CD% cd external-dist\CIPRES-and-deps rd /S /Q cipres-%CIPRES_VERSION% svn export http://nladr-cvs.sdsc.edu/svn/CIPRES/cipresdev/trunk/cipres cipres-%CIPRES_VERSION% jar cMf cipres-%CIPRES_VERSION%.zip cipres-%CIPRES_VERSION% move cipres-%CIPRES_VERSION%.zip %ORIG_DIR% copy /Y cipres-%CIPRES_VERSION%\cipres-build-scripts\build-for-windows\configureTools.bat . copy /Y cipres-%CIPRES_VERSION%\cipres-build-scripts\build-for-windows\findCipres.py . copy /Y cipres-%CIPRES_VERSION%\cipres-build-scripts\build-for-windows\readme.txt . cd .. jar cMf CIPRES-deps-and-source-win32.zip CIPRES-and-deps cd %ORIG_DIR% :Upload REM Update the dev_snapshot page with binary dist and log scp %BUILD_ID%.zip %USER%@%WEBSERVER%:%WEBDIR%/%DIST_NAME%.zip scp Build-Win32.log %USER%@%WEBSERVER%:%WEBDIR%/Build-Win32.log ssh %USER%@%WEBSERVER% chmod 664 %WEBDIR%/%DIST_NAME%.zip %WEBDIR%/Build-Win32.log ssh %USER%@%WEBSERVER% chgrp tol %WEBDIR%/%DIST_NAME%.zip %WEBDIR%/Build-Win32.log REM Update maintainer's page with the latest archive, configureTools.bat, and readme.txt scp maintainer-dist\CIPRES-deps-win32.zip %USER%@%WEBSERVER%:%WEBDIR_M%/CIPRES-deps-win32.zip scp cipres\cipres-build-scripts\build-for-windows\readme.txt %USER%@%WEBSERVER%:%WEBDIR_M%/readme.txt scp cipres\cipres-build-scripts\build-for-windows\configureTools.bat %USER%@%WEBSERVER%:%WEBDIR_M%/configureTools.bat ssh %USER%@%WEBSERVER% chmod 664 %WEBDIR_M%/CIPRES-deps-win32.zip %WEBDIR_M%/readme.txt %WEBDIR_M%/configureTools.bat ssh %USER%@%WEBSERVER% chgrp tol %WEBDIR_M%/CIPRES-deps-win32.zip %WEBDIR_M%/readme.txt %WEBDIR_M%/configureTools.bat REM update the external developer's page scp svnRevision_win.txt %USER%@%WEBSERVER%:%WEBDIR_SDK%/svnRevision_win.txt scp cipres-%CIPRES_VERSION%.zip %USER%@%WEBSERVER%:%WEBDIR_SDK%/cipres-%CIPRES_VERSION%.zip scp external-dist\CIPRES-deps-and-source-win32.zip %USER%@%WEBSERVER%:%WEBDIR_SDK%/CIPRES-deps-and-source-win32.zip ssh %USER%@%WEBSERVER% chmod 664 %WEBDIR_SDK%/svnRevision_win.txt %WEBDIR_SDK%/cipres-%CIPRES_VERSION%.zip %WEBDIR_SDK%/CIPRES-deps-and-source-win32.zip ssh %USER%@%WEBSERVER% chgrp tol %WEBDIR_SDK%/svnRevision_win.txt %WEBDIR_SDK%/cipres-%CIPRES_VERSION%.zip %WEBDIR_SDK%/CIPRES-deps-and-source-win32.zip REM update SDK page with build log and test results scp Build-Win32.log %USER%@%WEBSERVER%:%WEBDIR_SDK%/build-logs/%LOGFILE% ssh %USER%@%WEBSERVER% chmod 664 %WEBDIR_SDK%/build-logs/%LOGFILE% ssh %USER%@%WEBSERVER% chgrp tol %WEBDIR_SDK%/build-logs/%LOGFILE% scp -r cipres\cipres-examples\cipresapp\build\test-reports\html %USER%@%WEBSERVER%:%WEBDIR_SDK%/test-reports/%RESULTSDIR% ssh %USER%@%WEBSERVER% chgrp -R tol %WEBDIR_SDK%/test-reports/%RESULTSDIR% ssh %USER%@%WEBSERVER% chmod -R 775 %WEBDIR_SDK%/test-reports/%RESULTSDIR% :Cleanup del /Q %BUILD_ID_PATTERN%.zip for /f "delims=" %%a in ('dir "%BUILD_ID_PATTERN%" /s /b /ad 2^>NUL') do rd /s /q "%%a" del /Q cipres-%CIPRES_VERSION%.zip del /Q maintainer-dist\CIPRES-deps-win32.zip del /Q external-dist\CIPRES-deps-and-source-win32.zip :Exit exit /B 0 :Error set REPORT_RECIPIENT=%USER%@sdsc.edu email -f %REPORT_RECIPIENT% -n %USER% -s "windows nightly build failed" -r smtp.ucsd.edu -p 25 -b -a %BUILD_LOG_NAME% %REPORT_RECIPIENT% exit /B 1