March 5, 2007
About In Surround SCM, it is easy to create a Get trigger when you have a defined working directory. It is more complicated to perform a Get to any other location because the trigger requires a Get to path. The SSCMGet program allows you to enter a path to perform a Get to. This path is the root location and should represent a root repository location in Surround SCM that the trigger recursively monitors for changes. The repository path is then used (without the mainline name) to determine the Get path for subdirectories.
InstallationUnzip SSCMGet to a directory on the Surround SCM Server side where you want to run the application.
RunningSince there are so many arguments it is best to run the program through a batch, but it would be possible to setup a trigger to include all the required arguments without using a batch file. These instructions will be written assuming a batch file is used. It is necessary to setup a Surround trigger which will execute the script. The "Run Executable" settings require the path to the script itself, the repository/filename and the branch name. Here is an example of what the trigger settings would look like.
C:ScriptsSSCMGet.bat "%SSCM_REPOSITORY%/%SSCM_FILE%" "%SSCM_BRANCH%"The SSCMGet.exe program requires the following arguments in this order.
- Username:Password - Your Surround username and password.
- Server:Port - Your Surround server and port.
- Directory to copy out to - The target location (or root directory) to copy files out to.
- Repository name to trim - The part of the repository name to trim.
- Repository and Filename. The repository and filename in the format:
- Branch name - The Branch to perform the get from.
SSCMget.exe administrator:admin localhost:4900 C:TempSSCMGetTest "Mainline/Project 1/src/wwwroot" "Mainline/Project 1/src/wwwroot/default.htm"Here is the same command but run as a trigger.
"C:ScriptsSSCMget.exe" administrator:admin localhost:4900 C:TempSSCMGetTest Mainline/Project1 %1 %2
Example ScenarioHere is an outline of how the script functions and how a user can implement it properly. The path to my web server's home directory is currently set to '\WebServer1wwwroot' and I store my HTML documents in a Surround repository with the path of 'Mainline/Project 1/src/wwwroot'. I want to write a trigger that will update the \WebServer1wwwroot path with any changes recursively, however I do not want to setup a working directory to use that path (maybe the user only has CLI access). Using SSCMGet I can pass the following arguments.
sscmget.exe buildbot:seapine scmserver:4900 "\WebServer1wwwroot" "Mainline/Project 1/src/wwwroot" "Mainline/Project 1/src/wwwroot/docs/images/pic.gif" "Mainline"When I run the program an "sscm get" is performed. The SSCMGet.exe program will remove this part of the repository path "Mainline/Project 1/src/wwwroot" and use the remaining portion of the repository and filename path to copy the file out to "\WebServer1wwwrootdocsimagespic.gif". To automate this as a trigger I can use the same command in a batch file only needing to replace the last two arguments with input variables.
sscmget.exe buildbot:seapine scmserver:4900 "\WebServer1wwwroot" "Mainline/Project 1/src/wwwroot" %1 %2Then setup a trigger which points to the batch file itself and includes "%SSCM_REPOSITORY%/%SSCM_FILE%" "%SSCM_BRANCH%" which are the necessary two arguments that represent the repository/filename location of the file and the branch name. The script can be adapted in several ways. I can also run the script this way with the same results:
sscmget.exe buildbot:seapine scmserver:4900 "\WebServer1" "Mainline/Project 1/src" %1 %2
DownloadsBinary download v1.0.1Source download v1.0.1
- Rewrote the SSCMGet program to be more object oriented
- Much improved error handling
- Added a Repository to Replace value to better support any repository input value without needing re-programing
- Added additional message logging
- Updated SSCMGet.bat file with more ReadMe information
- When setting the path to copy files to, do not use a trailing backslash and surround the value in quotes.