Provisioning Example

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

The following example demonstrates provisioning a different resource based on the current user group and a property on the requested artifact.

The artifact vcsProj.conf.xml has a property vcs.rootUrl which holds the root URL for the version control system. A different project version control URL is returned depending on the user group.

For the template of vcsProj.conf.xml:

<servers>
<#list properties.get("vcs.rootUrl") as vcsUrl>
    <#list security.getCurrentUserGroupNames() as groupName>
    <vcs>${vcsUrl}/<#if groupName == "dev-product1">product1<#elseif groupName == "dev-product2">product2<#else>global</#if></vcs>
    </#list>
</#list>
</servers>

If the value of the vcs.rootUrl property on the vcsProj.conf.xml artifact is http://vcs.company.com and the file is downloaded by someone in the dev-product2 group, the returned value is:

<servers>
    <vcs> http://vcs.company.com/product2 </vcs>
</servers>