Siebel Installations >  Automatic Compilation of your Siebel Project in Windows

This is an automatic job that can compile your srf , run DDL Sync, create Browser Scripts, restart Siebel Server and IIS.This can be done using two batch files. CompilaAll.bat and compilesrf.bat. This setup uses one Siebel Server with IIS on the same server.The Webserver is on another Windows server. Tested with Windows Server 2008 R2.

Before you run the files please 
1. Reset these variables

SiebelToolsPath

ServerPath

LogPath

SADMINPASSWORD

siebelwebserver

2. Replace the folder path  called "C:\sba81\FullCompile\"    to where you keep the batch files.
3. There are several calls to czk. CZK is where the Czech language folder exists. Either remove this if you use only English or rename this if you want a second language compile.
4. This batch file uses master_ddlsync.ucf   file. This needs to be created using the Database Configuration Wizard that comes with Siebel.
5. IIS does not start or stop when it is called from a remote computer. This script can start or stop IIS only in the same Computer.I am using a script in each server to start and stop IIS, that is not the best way to run a Job.
6. Run this job by calling ComplieAll.bat without parameters. Keep both CompilaAll.bat and compilesrf.bat in the same folder.
7. Remember to save the .bat files as ANSI.


rem** Code for CompileAll.bat ***
title Fullcompile genbscript ddlsynccls@ECHO ONC:

rem *** Set the Folder paths*********
set SiebelToolsPath=C:\Siebel\8.1\Tools\BIN
set ServerPath=C:\sba81\siebsrvr
set LogPath=C:\sba81\FullCompile\Log
FOR /F "tokens=1-4 delims=. " %%I IN ('DATE /t') DO SET mydate=%%K_%%J_%%I
rem ************************************************
rem ** check folder exists *************************
If Not EXIST C:\sba81\FullCompile\Log mkdir C:\sba81\FullCompile\Log
If Not EXIST C:\sba81\siebsrvr\OBJECTS\czk\old_SRF mkdir C:\sba81\siebsrvr\OBJECTS\czk\old_SRF
If Not EXIST C:\sba81\siebsrvr\OBJECTS\ENU\old_SRF mkdir C:\sba81\siebsrvr\OBJECTS\ENU\old_SRF
echo *********Start new run ****** >> %LogPath%\%mydate%compilesrf.log
echo ToolsPath:         %SiebelToolsPath% >> %LogPath%\%mydate%compilesrf.log
echo SiebelServerPath:  %ServerPath% >> %LogPath%\%mydate%compilesrf.logecho LogfilePath:       %LogPath% >> %LogPath%\%mydate%compilesrf.log
echo MyDate:            %mydate% >> %LogPath%\%mydate%compilesrf.log


rem ************************************************
rem Call the srf compile
echo %date% %time%: start FullCompile >> %LogPath%\%mydate%compilesrf.log
C:cd C:\sba81\FullCompile\start "Execution" /wait C:\sba81\FullCompile\compilesrf.bat Fullcompile   >> %LogPath%\%mydate%compilesrf.log
echo %date% %time%: end FullCompile >> %LogPath%\%mydate%compilesrf.log

rem ************************************************
rem *** DDL-SYNC ***********************************
echo %date% %time%: start DDL_Sync >> %LogPath%\%mydate%compilesrf.log%ServerPath%\BIN\siebupg.exe /m %ServerPath%\BIN\master_ddlsync.ucf /autogo /q 
echo %date% %time%: end DDL_Sync >> %LogPath%\%mydate%compilesrf.log

rem ************************************************
rem *** Siebel Server & IIS shutdown**************** 
echo %date% %time%: shutdown Siebel Server >> %LogPath%\%mydate%compilesrf.log
net stop "Siebel Server Name from Windows Services" >> %LogPath%\%mydate%compilesrf.log
echo ....shutdown Siebel Server... timeout: 180s .... >> %LogPath%\%mydate%compilesrf.log
timeout 180

 

rem ************************************************
rem *** Archive old srf, activate new*
echo %date% %time%: start archive SRF >> %LogPath%\%mydate%compilesrf.log
start "Execution" /wait C:\sba81\FullCompile\compilesrf.bat ArchiveSRF   >> %LogPath%\%mydate%compilesrf.log
echo %date% %time%: end archive SRF >> %LogPath%\%mydate%compilesrf.log
rem ************************************************
rem *** Delete old genbscript-Folder****************


PushD C:\sba81\siebsrvr\WEBMASTERFor /f %%j in ('Dir /B /AD srf*') Do (RD /S /Q C:\sba81\siebsrvr\WEBMASTER\%%j)PopD

rem ************************************************
rem *** execute genbscript**************************
echo %date% %time%: start genbscript >> %LogPath%\%mydate%compilesrf.log
%ServerPath%\bin\genbscript.exe %ServerPath%\bin\czk\siebel.cfg %ServerPath%\WEBMASTER\czk czk >> %LogPath%\%mydate%compilesrf.log%ServerPath%\bin\genbscript.exe
%ServerPath%\bin\czk\siebel.cfg  \\siebelwebserver\d$\sba81\SWEApp\PUBLIC\czk czk >> %LogPath%\%mydate%compilesrf.log%ServerPath%\bin\genbscript.exe
%ServerPath%\bin\enu\siebel.cfg %ServerPath%\WEBMASTER\enu enu >> %LogPath%\%mydate%compilesrf.log
%ServerPath%\bin\genbscript.exe %ServerPath%\bin\enu\siebel.cfg \\siebelwebserver\d$\sba81\SWEApp\PUBLIC\enu enu >> %LogPath%\%mydate%compilesrf.log
echo %date% %time%: end genbscript >> %LogPath%\%mydate%compilesrf.log

rem ************************************************
rem *** Start Siebel Server & IIS ***************** 
rem *** This timeout is needed to copy the srf files and finish genbsrcipt before Siebel Server starts timeout 500
echo %date% %time%: startup Siebel Server >> %LogPath%\%mydate%compilesrf.lognet start "Siebel Server Service Name" >> %LogPath%\%mydate%compilesrf.log
echo %date% %time%:  ... starten laeuft ... >> %LogPath%\%mydate%compilesrf.log
rem *** Siebel Server needs some time to restart, so we add a pause of 5 minutes 
timeout 300

echo *********end run of Compilation************ >> %LogPath%\%mydate%compilesrf.log

rem** End Code for CompileAll.bat ***

 

rem** Start Code for compilesrf.bat ***
title Compile srf
cls
@ECHO ON
C:
set SiebelToolsPath=C:\Siebel\8.1\Tools_1\BIN
set ServerPath=C:\sba81\siebsrvr
set LogPath=C:\sba81\Siebel_Jobs\FullCompile\Log

IF %1==Fullcompile GOTO Compile1
IF %1==ArchiveSRF GOTO Compile2


:Compile1
GOTO Compile12
:Compile12
echo %date% %time%: start FullCompile CZK und ENU >> %LogPath%\%mydate%_FullCompile2.log
%SiebelToolsPath%\siebdev.exe /c "%SiebelToolsPath%\ENU\tools.cfg" /d ServerDataSrc /u sadmin /p SADMINPASSWORD /tl CZK /bc "Siebel Repository" %ServerPath%\objects\CZK\siebelCZK_fullcompile.srf   >> %LogPath%\%mydate%_FullCompile2.log
%SiebelToolsPath%\siebdev.exe /c "%SiebelToolsPath%\ENU\tools.cfg" /d ServerDataSrc /u sadmin /p SADMINPASSWORD /tl ENU /bc "Siebel Repository" %ServerPath%\objects\ENU\siebelENU_fullcompile.srf   >> %LogPath%\%mydate%_FullCompile2.log
echo %date% %time%: end FullCompile >> %LogPath%\%mydate%_FullCompile2.log
GOTO Ende

:Compile2
echo %date% %time%: start archive and replace >> %LogPath%\%mydate%_FullCompile2.log
IF NOT %EingabeWert%==3 (GOTO Compile21) else (GOTO Compile22)
:Compile21
echo %date% %time%:Compile21
move %ServerPath%\objects\%lang%\siebel_sia.srf "%ServerPath%\OBJECTS\%lang%\old_SRF\%mydate%_siebel_sia.srf"
ren %ServerPath%\objects\%lang%\siebel%lang%_fullcompile.srf siebel_sia.srf
echo %date% %time%: end archive and replace >> %LogPath%\%mydate%_FullCompile2.log
GOTO Ende
:Compile22
echo %date% %time%: Compile22 start archive and replace >> %LogPath%\%mydate%_FullCompile2.log
C:
cd C:\sba81\siebsrvr\OBJECTS\CZK
IF EXIST  %ServerPath%\objects\CZK\siebel_sia.srf move %ServerPath%\objects\CZK\siebel_sia.srf "%ServerPath%\OBJECTS\CZK\old_SRF\%mydate%_siebel_sia.srf"  >> %LogPath%\%mydate%_FullCompile2.log
IF EXIST %ServerPath%\objects\CZK\siebelCZK_fullcompile.srf ren %ServerPath%\objects\CZK\siebelCZK_fullcompile.srf siebel_sia.srf >> %LogPath%\%mydate%_FullCompile2.log
cd C:\sba81\siebsrvr\OBJECTS\enu
IF EXIST  %ServerPath%\objects\ENU\siebel_sia.srf move %ServerPath%\objects\ENU\siebel_sia.srf "%ServerPath%\OBJECTS\ENU\old_SRF\%mydate%_siebel_sia.srf"  >> %LogPath%\%mydate%_FullCompile2.log
IF EXIST  %ServerPath%\objects\ENU\siebelENU_fullcompile.srf ren %ServerPath%\objects\ENU\siebelENU_fullcompile.srf siebel_sia.srf >> %LogPath%\%mydate%_FullCompile2.log
echo %date% %time%: end archive and replace >> %LogPath%\%mydate%_FullCompile2.log
:Ende
exit

rem** End Code for compilesrf.bat ***