Commit b65c515f authored by dwentzel's avatar dwentzel
Browse files

adding stuff

parent 62c8ee7e
Loading
Loading
Loading
Loading
+52.4 KiB

File added.

No diff preview for this file type.

+99 −0
Original line number Diff line number Diff line
@ECHO OFF
REM Vars
SETLOCAL ENABLEDELAYEDEXPANSION
SET TFPATH="c:\program files\Microsoft Visual Studio 9.0\Common7\Tools"
SET TFServer=http://STP2:8080
SET TFUser=MAXGATE\tfsservice
SET MyLocation="%CD%"
SET SQLServer="(local)\PCMX"
REM this is my net new database, we delete this before every run
SET NETNEW="NETNEW"
REM net start "SQL Server (SQLEXPRESS)"
REM this is my MaxDemoDB...we delete this before every run
SET PORTED="MaxDemoDB"
SET WorkingFolder="c:\logs"


MD %WorkingFolder%

FOR /F "eol=; tokens=1,2,3 delims=," %%i in (branches.txt) do (

REM  --------------------------------------------------------------------------------------------------
REM  Internal Loop Vars from branches.txt
SET CITSourcePath=%%k
SET CITWorkSpaceName=%%j
SET TFScriptsPath=%%i
@EcHO Running CIT for %%i %%j %%k
@ECHO !SQLServer! !NETNEW1 !PORTED! !WorkingFolder! !MyLocation!
REM  --------------------------------------------------------------------------------------------------


REM  --------------------------------------------------------------------------------------------------
REM  Setup TFS
REM  
call %TFPATH%\vsvars32.bat
cd /D c:\

echo YES|tf workspace /delete %%j /s:%TFServer%
md %%k
cd %%k
echo y|del %%k\*.*
tf workspace /new /s:%TFServer% /noprompt %%j;%TFUser%
tf workfold /server:%TFServer% /workspace:%%j /map %%i %%k
tf get %%k /force /recursive
REM  --------------------------------------------------------------------------------------------------


REM  --------------------------------------------------------------------------------------------------
REM  Setup DB Env
REM  blow away NETNEW and MaxDemoDB if they exist
cscript //E:vbscript %MyLocation%\manipulate_db.v-b-s %SQLServer% %WorkingFolder% %NETNEW% %MyLocation%
cscript //E:vbscript %MyLocation%\manipulate_db.v-b-s %SQLServer% %WorkingFolder% %PORTED% %MyLocation%
REM  
REM  --------------------------------------------------------------------------------------------------

REM this is set in setup.vbs as one of the first steps.  
@echo %MasterLogFile%

REM  --------------------------------------------------------------------------------------------------
ECHO Run Porting
cscript //E:vbScript //Nologo setup.vbs %SQLServer% %PORTED% "" "" %WorkingFolder% "" "x.x.x" %WorkingFolder%
ECHO ERRORLEVEL from %PORTED% call to setup.vbs is !ERRORLEVEL!
IF !ERRORLEVEL!==1 (
	cscript //E:vbscript %MyLocation%\mail.v-b-s "FAILURE" %%i
	echo Failure Email Sent
	) ELSE (
	echo Running %NETNEW%
	cscript //E:vbScript //Nologo setup.vbs %SQLServer% %NETNEW% "" "" %WorkingFolder% "" "x.x.x" %WorkingFolder%
	ECHO ERRORLEVEL from %NETNEW% call to setup.vbs is !ERRORLEVEL!
	IF !ERRORLEVEL!==1 (
		cscript //E:vbscript %MyLocation%\mail.v-b-s "FAILURE" %%i
		echo Failure Email Sent
		) ELSE (
		cscript //E:vbScript //Nologo GenerateDiscrepancyReport.vbs %SQLServer% "" "" %WorkingFolder% %NETNEW% %PORTED%
		cscript //E:vbscript %MyLocation%\mail.v-b-s "SUCCESS" %%i
		)
	)




)


REM  --------------------------------------------------------------------------------------------------
REM  Cleanup DB Env
REM  blow away NETNEW and MaxDemoDB if they exist
cscript //E:vbscript %MyLocation%\manipulate_db.v-b-s %SQLServer% %WorkingFolder% %NETNEW% %MyLocation%
cscript //E:vbscript %MyLocation%\manipulate_db.v-b-s %SQLServer% %WorkingFolder% %PORTED% %MyLocation%
REM  
REM  --------------------------------------------------------------------------------------------------


REM  --------------------------------------------------------------------------------------------------
REM  cleanup WorkingFolder
rd /S/Q %WorkingFolder%
REM  --------------------------------------------------------------------------------------------------


ENDLOCAL
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
REM Vars
SET TFPATH="c:\program files\Microsoft Visual Studio 8\Common7\Tools"
SET CITSourcePath="C:\Projects\Development\STP Database\scripts"
SET CITWorkSpaceName=DWENTZELLP
SET TFServer=STP
SET TFUser=MAXGATE\dwentzel
SET TFScriptsPath="$/MaxwellSTP/Development/STP Database/Scripts"
SET MyLocation=%CD%
SET SQLServer="(local)\PROCONTRACTORMX"
SET NETNEW="NETNEW"
SET PORTED="MaxDemoDB"

call %TFPATH%\vsvars32.bat
cd /D c:\

tf get %CITSourcePath% /force /recursive



:END
+22 −0
Original line number Diff line number Diff line
;this lists the branches we wish to execute CIT for
;each line takes the form "TFScriptsPath","CITWorkSpaceName","CITSourcePath"
"$/MaxwellSTP/Development/STP Database/Scripts","CIT_TRUNK","c:\CIT_TRUNK"
"$/MaxwellSTP/Releases/2.3/STP Database/Scripts","CIT_2.3","c:\CIT_2.3"
"$/MaxwellSTP/Branches/EstRounding/STP Database/Scripts","CIT_EstRounding","c:\CIT_EstRounding"
"$/MaxwellSTP/Branches/TimeImport/STP Database/Scripts","CIT_TimeImport","c:\CIT_TimeImport"
"$/MaxwellSTP/Branches/ITB/STP Database/Scripts","CIT_ITB","c:\CIT_ITB"














+89 −0
Original line number Diff line number Diff line
'Name:  smtp_mail_test.vbs
'Date:  20040322
'Purpose: tests connectivity to send smtp mail from a given server.  
'  
'Developer History:
'Name  Date Change Description
'
'
'

Set args = Wscript.Arguments
For iArg = 0 To args.count -1
        MsgToEmail = args(0)
        BranchPath = args(1)
Next 



smtpserver="kopexch2.maxwellsystems.com"

fromemail="CITProcess@maxwellsystems.com"
toemail = "dwentzel@maxwellsystems.com;jprodgers@maxwellsystems.com"
Call Mailer ("Success")
wscript.sleep 5000

Public Sub Mailer (Status)
 Dim iMsg, iConf, iBp, Flds, EUsrs
 
 Set iMsg = CreateObject("CDO.Message")
 Set iConf = CreateObject("CDO.Configuration")
 Set Flds = iConf.Fields
 
 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver")       = smtpserver
 Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverport")   = 25
 Flds("http://schemas.microsoft.com/cdo/configuration/sendemailaddress")     = """CP"" dwentzel@maxwellsystems.com"
 Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")     = cdoAnonymous ' 0
 Flds("http://schemas.microsoft.com/cdo/configuration/sendusing")  =  2
 Flds.Update
 
 EUsrs = toemail
 
 set shell = CreateObject("wscript.shell")
 set sysEnv = shell.Environment("SYSTEM")
 
 
 if MsgToEmail = "SUCCESS" then
  BodyText = "CIT succeeded for branch path:  " & BranchPath
  'for success cases we want to email the discrepancies file always...but no log file
  LogFile = "NoFileNeeded"
  DiscrepFile = sysEnv("DiscrepLogFile")
 elseif MsgToEmail = "FAILURE" then
  BodyText = "CIT failed, examine logs for branch path:  " & BranchPath
  'For failure cases we need the log file but not the discrepancy file since it won't exist
  LogFile = sysEnv("MasterLogFile")
  DiscrepFile = "NoFileNeeded"
 elseif MsgToEmail = "TEST" then
  BodyText = "test of smtp"
DiscrepFile = "NoFileNeeded"
LogFile = "NoFileNeeded"
 end if
 
 
  
 With iMsg
 'Apply Configuration and prepare to send file
 Set .Configuration = iConf
    .To          = EUsrs
    .Cc   = ""
    .From        = fromemail
    .Sender      = fromemail
    .Subject     =  BodyText
    .TextBody    =  BodyText
    if LogFile <> "NoFileNeeded" Then
    	Set iBP = .AddAttachment(LogFile)
    	iBP.ContentMediaType="application/zip"
    End If
    
    if DiscrepFile <> "NoFileNeeded" Then
        	Set iBP = .AddAttachment(DiscrepFile)
        	iBP.ContentMediaType="application/zip"
    End If
    .Send
 End With
 
 Set iMsg = Nothing
 Set iConf = Nothing
 Set Flds = Nothing
End Sub
 
 No newline at end of file
Loading