User Interface plugin modules
Build Lifecycle plugin modules
Notification plugin modules
System plugin modules

Source Repository module

Available:

Bamboo 1.1 and later

Description

A plugin module which defines a repository in Bamboo, such as CVS, Subversion, or Perforce.

Interface

Plugins of this type must implement the com.atlassian.bamboo.repository.Repository interface. For (comparative) simplicity, you should use the class AbstractRepository as a starting point and extend from that.

Sample Module Descriptor Element

1
2
<repository key="svn" name="SVN Repository"
                    class="com.atlassian.bamboo.repository.svn.SvnRepository">
    <description>A Subversion Repository</description>
    <resource type="freemarker" name="edit" location="templates/plugins/repository/svnRepositoryEdit.ftl"/>
    <resource type="freemarker" name="view" location="templates/plugins/repository/svnRepositoryView.ftl"/>
</repository>

Extensions

RepositoryEventAware

Description

The RepositoryEventAware interface allows you to instruct the repository to perform a custom action before and/or after the checkout/update occurs.

PostConfigurableRepository

The PostConfigurableRepository allows any custom configuration to be performed after the repository has been created or another has been selected. It is typically used to add and remove configuration after changes have been made to the repository configuration by a user.

CustomVariableProviderRepository

The CustomVariableProviderRepository allows to define custom variables that can be used to configure the plan.

Supporting "Import from Maven"

By implementing MavenPomAccessorCapableRepository on your repository module this interface allows your Source Repository Module to be used from the 'Import a Maven 2 project' feature.

The MavenPomAccessorCapableRepository.getMavenPomAccessor() should return your own implementation of the MavenPomAccessorAbstract class that provides the ability to checkout and find the Maven pom from the repository provided by the user.

Examples

Add a line similar to the one below to your repository descriptor in the atlassian-plugin.xml. This is similar to the "edit" resource

1
2
<resource type="freemarker" name="mavenPomCheckoutAccessEdit" location="templates/plugins/repository/p4RepositoryMavenPomCheckoutAccessEdit.ftl"/>

Here is the example Freemarker template:

1
2
[#if repository.perforceExecutableSet]
    <div class="infoBox">
        [@ww.text name='repository.p4.executableExists']
            [@ww.param]${repository.p4Executable}[/@ww.param]
        [/@ww.text]
     </div>
[#else]
     <div class="warningBox">
        [@ww.text name='repository.p4.noExecutable']
            [@ww.param]${req.contextPath}/admin/agent/configureSharedLocalCapabilities.action[/@ww.param]
        [/@ww.text]
     </div>
[/#if]

[@ww.textfield labelKey='repository.p4.port' name='repository.p4.port' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.client' name='repository.p4.client' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.depot' name='repository.p4.depot' required='true' helpKey='perforce.fields' /]
[@ww.textfield labelKey='repository.p4.mavenPomCheckout.pomRelativePath' name='repository.p4.mavenPomCheckout.pomRelativePath' /]
[@ww.textfield labelKey='repository.p4.username' name='repository.p4.user' helpKey='perforce.fields' /]
[@ww.hidden name="temporary.p4.passwordChange" value="true" /]
[@ww.password labelKey='repository.p4.password' name='temporary.p4.password' helpKey='perforce.fields' required='false'/]

Rate this page: