Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

How to change workspace location? #1727

tms_sooraj ·
I would like to place my QuickBuild workspace (i.e. working directory) on a different disk drive on my machine. Currently the workspace gets created in the QB install directory.

How do I change the workspace to get created on a different disk?
  • replies 9
  • views 4026
  • stars 0
robinshen ADMIN ·
This can be done by changing workspace setting in advanced setting of the root configuration to use specified workspace path as below:
/path/to/workspace/${configuration.pathName}
drdt ·
Here is a variable definition I put together to define an alternate workspace directory on the configuration level:

${groovy:
int buildsDir = configuration.getPathName().indexOf( "builds", 0 )
int pathStart = configuration.getPathName().indexOf( "/", buildsDir )

if ((buildsDir >= 0) && (pathStart >= 0) && node.hasAttribute( "BUILDDRIVE" )) {
node.getAttribute( "BUILDDRIVE" ) + "/" + configuration.getPathName().substring( pathStart )
\} else {
system.getWorkspaceDir().getAbsolutePath() + "/" + configuration.getPathName()
\}
}

If BUILDDRIVE is not defined on the system, it uses the default path inside of the QuickBuild install directory.
If BUILDDRIVE is defined, it puts all work spaces for configurations under the 'root/builds' configuration on BUILDDRIVE.

So, for example, configuration root/builds/Product/Branch/Nightly will be built in %BUILDDRIVE%\Product\Branch\Nightly (or, on unix, $BUILDDRIVE/Product/Branch/Nightly).
Configurations not under root/builds/... will also go in the default location.

This also works if your builds directory is called 'test-builds' or 'builds-v1', or 'product_builds'.
tms_sooraj ·
Hi Rob,

The "/path/to/workspace" that I give, gets created within the QB install directory.

i.e. If I have my QB installed on F drive of my server, the default workspace (without making the root workspace advance setting) looks like "F:\Program Files\quickbuild-4.0.12\workspace\" and the code gets checked out in this location.
If I make the workspace advance setting on root (as you mentioned), the code gets checked out to "F:\Program Files\quickbuild-4.0.12\workspace\path\to\workspace\..."

I will need the code to be checked on a different drive of the server, say, "G:\workspace\..." even though QB is installed on F: drive. However this location cannot be hardcoded at root, as all the build agents need not have G drive.

Please let me know.
robinshen ADMIN ·
On Windows platform, the driver letter needs to be prefixed to make it an absolute path. So instead of using "/path/to/workspace/${configuration.pathName}", you may use "G:/workspace/${configuration.pathName}". Further, if different workspace root should be used for different nodes, you may define the workspace setting like below:

${node.hasAttribute("workspaceRoot")?node.getAttribute("workspaceRoot"): system.workspaceDir.absolutePath}/${configuration.pathName}


This script tells QB to check if a workspaceRoot user attribute is defined for a node, if yes, then use that as workspace root, otherwise, use the default workspace root under QB installation directory.

Then for node you'd like to specify a different workspace root, just define the user attribute "workspaceRoot" in grid tab, with value for instance:
F:\workspace
tms_sooraj ·
Hi Rob,

As you suggested, I'd placed the given script in the root configuration and added node user attribute "worskpaceRoot" with the value "G:\TSCM_V3\workspace".

While creating the workspace, QB rightly picks up the "workspaceRoot" value. However, it still tries to create it under default workspace. Also, don't know why it tries to create it recursively.

Please find the error message:
Unable to create directory: F:\Program Files\quickbuild-4.0.12\workspace\"G:\TSCM_V3\workspace"\TMS\TIP\TIP_Web\"G:\TSCM_V3\workspace"\TMS\TIP\TIP_Web\"G:\TSCM_V3\workspace"\TMS\TIP\TIP_Web

Whatever script or value, we give in the root workspace configuration, it tries to create the same under default workspace and add the configuration.pathName to it.
robinshen ADMIN ·
Can you please send your database backup to [robin AT pmease DOT com], and let me know which configuration to look at? I will check what might be the problem.
tms_sooraj ·
Hi Rob,

I've sent you the database back up.

TMS is the root configuration in which workspace location setting has been edited. The build on the configuration TIP/TIP_Web was tried and it failed. The node VCTMSDASV25 is the server node in which the UserAttribute "workspaceRoot" has been defined.
robinshen ADMIN ·
Strangely I did not get your email yet. Can you please send again? And cc to [yujiang.shen AT gmail DOT com] also. Sorry for the inconvenience.
tms_sooraj ·
Resent it. May the .zip extension was filtered due to restrictions. I have renamed the file as DB_Backup_013112.zib and sent it again to bothe the email IDs. Please check.