Set of shared resources

Hi Support-Team,
can I somehow create a set of shared resources so that a build needs to take one but its not specified which one?

Scenario:
I have multiple shared resources and each of them represents a directory. When a build starts I want that the build aquires/locks one of these resources (directories). If there is no resource available he should wait until he can aquire one. During the build I want know which resource/directory was aquired and want to work on/with it.

Albrecht

Hi Albrecht,

You can achieve the first part of your question using a Quota List shared resource. This can have multiple labels (one for each of your directories). When you define the shared resource lock for a configuration or stage, you can choose Acquire Any to pick any one to the quota list labels.

Unfortunately, we don’t have any expression defined as yet to query which shared resource label(s) were acquired by your build. We have however been looking into this today and we hope to be able to implement a $Build.SharedResourceLabels$ expression for the next version in the next day or two. 

Hi Albrecht,

We just uploaded a new version 1.8.1.579 which includes new Shared Resources expression objects you can use to know which label(s) were acquired.




Thanks Dave, I will test it soon.

Hi Dave,
i tested it now. But with the current version I have one problem. I the previous version I had the possibility to get the labels of a specific shared resource ($Build.SharedResourceLabels.SharedResourceName$). And on this object I was able to get some additional informations (get all, the first or the last label …). In the current Version 1.8.1.630 I couldn’t find this object anymore. Is it removed completly or only moved to another place?

Hi Albrecht,

The object you are looking for is $Build.SharedResources.FullSharedResourcePath

e.g. $Build.SharedResources.Server.Namespace.SR1.Labels


Hi Dave,
thanks for help. I found that the ‘Agent’-object is not displayed as popup when i have inserted $Build.SharedResources. So I had to type it manually and it was not clear for me that this object is available. Will it be readded in the next version? And i would be great if you can update Expression-Objects-help with the new objects.

Hi Albrecht,

The Agent object is available in expressions only if an agent shared resource lock is associated with the stage. Ensure that it has been added to the Shared Resource Locks tab in the Stage Options dialog and the stage has been saved.

We’ll get on to updating the documentation soon - we all prefer coded so it often gets left behind.

Hi Dave,
I checked that the shared-resource-locks are assigned to the current stage. But it did not work. I tested it with a older configuration and there it works only for shared-resource-locks which where assigned some time ago (before i made the last update).
It seems that either with the shared-resource-locks itself or with the assignment of shared-resource-locks to stages went something wrong in the last update.

Hi Albrecht,

Did you save all changes to the stage editor e.g. by clicking on the Save All button before testing this? The auto-completion for expressions is calculated server-side so you need to save the stages before it knows about any changes. Clicking on Save in the dialog does not save changes to the server, the changes are stored client-side until one of the Save buttons is clicked on the main page. We are going to change this to an OK button to avoid confusion.

After clicking Save All, all the associated shared resources are available to expressions in our tests. Nothing has changed in the code to do this between the last two versions.


Hi Dave,
I tested it. I changed the aquired Shared-resource-locks pressed Save-All-Stages and edited a existing Log-Action. After $Build.SharedResources.$ there was no popup. I had in this stage some already existing aquired locks and a new one. I tested it also with a new Log-Action. Also with no success.
But anyway it is only the popup, if i type it manually the expression is evaluated.
Thanks for help.