Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
I'm developing a batch file where I set the project location on the server and a label from a checkpoint. Based on this info I create a sandbox.
The scenario has to be like this:
- if the sandbox exist: resynchronize it with the mentioned checkpoint revision
- if it's not, then create it
Solved! Go to Solution.
Hi Anamaria,
Here's how I'd do it
First there is no direct way to set a sandbox to a "project label"- but you can use the project label to get the according checkpoint number:
"si viewprojecthistory --rfilter=labeled:<your label>" should help you.
The most straight forward way now would be to use "si createsandbox" to create a new build sandbox in your target directory, but as this will break if there already is a sandbox, you'll have to do more.
First check the server's target Dir for any "project.pj" files (that indicate that there already is or was a sandbox)
If you find something you can use "si sandboxes" and check whether there is a sandbox already registered for you.
If not you can try to import this sandbox or (as I'd do it) simple erase the entire folder on the server and create a new sandbox.
Lets assume you found a sandbox that is already registered for you, you can use "si retargetsandbox" to retarget the sandbox to your checkpoint number.
Calling "si resync <server's sandbox>" will to the rest.
HTH Matthias
Hi,
there are several CLI commands for creating, configuring and re-synchronizing a sandbox.
They are described in the following document:
http://support.ptc.com/WCMS/files/160843/en/SourceCLIReference_Integrity_10_5.pdf
Regards,
Peter
Hi Anamaria,
Here's how I'd do it
First there is no direct way to set a sandbox to a "project label"- but you can use the project label to get the according checkpoint number:
"si viewprojecthistory --rfilter=labeled:<your label>" should help you.
The most straight forward way now would be to use "si createsandbox" to create a new build sandbox in your target directory, but as this will break if there already is a sandbox, you'll have to do more.
First check the server's target Dir for any "project.pj" files (that indicate that there already is or was a sandbox)
If you find something you can use "si sandboxes" and check whether there is a sandbox already registered for you.
If not you can try to import this sandbox or (as I'd do it) simple erase the entire folder on the server and create a new sandbox.
Lets assume you found a sandbox that is already registered for you, you can use "si retargetsandbox" to retarget the sandbox to your checkpoint number.
Calling "si resync <server's sandbox>" will to the rest.
HTH Matthias
Hi,
Thanks for your replies!
Peter, unfortunately I don't have rights to see that file (http://support.ptc.com/WCMS/files/160843/en/SourceCLIReference_Integrity_10_5.pdf) but, I found a website with all the CLI commands.
My solution was to configure the subproject using that label (--projectRevision supports both; revision number or label) and then to resynchronize my sandbox.
I didn't noticed the retargetsandbox command, so thank you Matthias, tomorrow I will definitely try it.
Thank you both!
Ana
Hi Ana,
just for savety reasons:
You do know that the "si configuresubproject" command manipulates the serverside (like "in the integrity database") repository.
This should never be the way to go when all you want to do is define the content of a sandbox.
HTH Matthias
Hello Matthias,
Unfortunately the "si retargetSandbox" it's not working for me.
Because, it's working just on top level sandbox and, also, projects. I tried to perform this command on a top level sandbox, it worked fine, but when I try to see the sandbox in IMS I recieve an error, because the project is not registered as a top level project.
Ana
Hi Ana,
maybe you could tell us more about your usecase, as I am not really sure whether I understand your needs.