Seapine Labs
Personal tools

SSCM Get

From Seapine Labs

Jump to: navigation, search

Contents

[edit] SSCM Get

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.

[edit] Installation

Unzip SSCMGet to a directory on the Surround SCM Server side where you want to run the application.

[edit] Running

Since 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:\Scripts\SSCMGet.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.

\\WebServer1\wwwroot

  • Repository name to trim - The part of the repository name to trim.

"Mainline/Project 1/src/wwwroot"

  • Repository and Filename. The repository and filename in the format:

"Mainline/Project 1/src/wwwroot/default.htm"

  • Branch name - The Branch to perform the get from.

Here is an example batch command that is not run from a trigger.

SSCMget.exe administrator:admin localhost:4900 C:\Temp\SSCMGetTest "Mainline/Project 1/src/wwwroot" "Mainline/Project 1/src/wwwroot/default.htm"

Here is the same command but run as a trigger.

"C:\Scripts\SSCMget.exe" administrator:admin localhost:4900 C:\Temp\SSCMGetTest Mainline/Project1 %1 %2

[edit] Example Scenario

Here 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 '\\WebServer1\wwwroot' 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 \\WebServer1\wwwroot 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 "\\WebServer1\wwwroot" "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 "\\WebServer1\wwwroot\docs\images\pic.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 "\\WebServer1\wwwroot" "Mainline/Project 1/src/wwwroot" %1 %2

Then 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

[edit] Downloads

Binary download v1.0.1

Source download v1.0.1

[edit] Release Notes

1.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

[edit] Known Issues

  • When setting the path to copy files to, do not use a trailing backslash and surround the value in quotes.



Note: Seapine does not provide support for sample triggers and scripts.














Issue Management Software | Source Code Control Software | Test Case Management