How can we help you today? How can we help you today?
bhopenw
Okay this some what pieced together b/c my scripts run on a platform of scripts we have developed and would not make a whole lot o sense if I posted them stright up Below is the TeamBuild targets that could be used we use team build to set up the workspace where the scripts folder is we also have argument xml checked and this is what we call from the cmd line, makes it easy and we have a record of what is being called <Target Name="AfterBuildDrop" Condition="$(SyncDB) == 'true'"> <AddBuildStep BuildUri="$(BuildUri)" BuildStepName="DB_Sync" BuildStepText="Search DB_ Dev for latest HRLYCLDL Scripts" /> <Exec Command="powershell -c ".\BuildScripts\DB_Sync.ps1 '$(SolutionRoot)' '$(DropLocation)'"" WorkingDirectory="$(PowerShellScripts)" IgnoreExitCode="true"> <Output TaskParameter="ExitCode" PropertyName="DB_ExitCode" /> </Exec> <Error Condition="$(DB_ExitCode)==2" Text="There was an unhandle exception in the DB Sync script " /> <Error Condition="$(DB_ExitCode)==1" Text="General error code." /> <Error Condition="$(DB_ExitCode)==8" Text="Unsatisfied argument dependency or violated exclusion when user runs command line. E.g. /arg2 depends on /arg1 but you have specified /arg2 without specifying /arg1, or alternatively /arg2 cannot be used with /arg1 but you have tried to use them both." /> <!-- should have all the Red Gate error msg catches here <UpdateBuildStep BuildUri="$(BuildUri)" BuildStepName="DB_Sync" BuildStepResult="true" /> <OnError ExecuteTargets="OnErrorDB_Sync"/> </Target> <Target Name="OnErrorDB_Sync" > <UpdateBuildStep BuildUri="$(BuildUri)" BuildStepName="DB_Sync" BuildStepResult="false" /> </Target> Now here is the DB_Sync.ps1 param($slnRoot = $(throw 'The snl root path is needed'), $dropLoc = $(throw 'The Build Drop location is required')) trap { $host.SetShouldExit(2) return $false } function get-ErrorMsg ([int] $exitCode) { # These messages were copied from the SQLCompare.exe -help section #if SQL Compare is updated need to ensure that the below holds true [string] $errMsg = "" switch ($exitCode) { 1 { $errMsg = "General error code." } 3 { $errMsg = "Illegal argument duplication. Some arguments may not appear more than once in a command-line. If such arguments appear more than once this exit code will be returned." } 8 { $errMsg = "Unsatisfied argument dependency or violated exclusion when user runs command line. E.g. /arg2 depends on /arg1 but you have specified /arg2 without specifying /arg1, or alternatively /arg2 cannot be used with /arg1 but you have tried to use them both." } 32 { $errMsg = "Value out of range. Numeric value supplied for an argument that is outside the range of valid values for that argument." } 33 { $errMsg = "Value overflow. The magnitude of a value supplied for an argument is too large and causes an overflow." } 34 { $errMsg = "Invalid value. The value supplied for an argument is invalid." } 35 { $errMsg = "No / invalid software license or trial period has expired." } 63 { $errMsg = "The databases being compared are identical with respect to any constraints on objects being compared." } 64 { $errMsg = "General command-line usage error." } 65 { $errMsg = "Data error. Some input data required by the tool is invalid or corrupt." } 69 { $errMsg = "A resource or service required to run the tool is unavailable." } 73 { $errMsg = "Failed to create report" } 74 { $errMsg = "IO error occurred. Generally returned if the program attempts to write to a file that already exists without the user having specified the /force option." } 77 { $errMsg = "Action cannot be completed because the user does not have permission." } 126 { $errMsg = "Execution failed because of an error." } 130 { $errMsg = "Execution stopped because Ctrl+Break." } } return $errMsg } ###MAIN### #set XML args paths $sqlCompareArgsPath_sync = Join-Path $slnRoot "\XmlArgs\Sync.xml" #set output area $outputResults = Join-Path $dropLoc "SyncResults.log" pushd "C:\Program Files\Red Gate\SQL Compare 8" #run sync job $rs = .\sqlcompare.exe /argfile:"$($sqlCompareArgsPath_Sync)" #catch exit code [int] $sqlExitCode = $lastExitCode $rs | Out-File -FilePath $outputResults -Force -Append if ($sqlExitCode -ne 0) { [string] $errMsg = get-ErrorMsg $sqlExitCode write-error $errMsg $host.SetShouldExit($sqlExitCode) } popd This has been simplified but is should work I hope this helps Thanks, BJHop / comments
Okay this some what pieced together b/c my scripts run on a platform of scripts we have developed and would not make a whole lot o sense if I posted them stright up Below is the TeamBuild targets t...
0 votes
Eddie, Thank you for your response I guess I forgot to mention that we looked into the registry at all the keys for both Red Gate, MSSCCI and TFS All seemed to correct including the below path you gave me in you Keys we looked at were HKEY_LOCAL_MACHINE\software\SourceCodeControlProvider {RoboSource Control 3, Microsoft Team Foundation Server MSSCCI Provider} HKEY_LOCAL_MACHINE\software\Red Gate\Downloads HKEY_LOCAL_MACHINE\software\Red Gate\Licensing HKEY_LOCAL_MACHINE\software\Red Gate\SQL Backup HKEY_LOCAL_MACHINE\software\Red Gate\SQL Changeset HKEY_LOCAL_MACHINE\software\Red Gate\Update HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\EA500 HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\Microsoft Visual Basic HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\Microsoft Visual C++ HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\Microsoft Visual FoxPro HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\PowerBuilder HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\Quest Team Coding HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\VsScc HKEY_LOCAL_MACHINE\software\Microsoft\Team Foundation Server MSSCCI Provider\settings\VssProvider / comments
Eddie, Thank you for your response I guess I forgot to mention that we looked into the registry at all the keys for both Red Gate, MSSCCI and TFS All seemed to correct including the below path you ...
0 votes