Creating source templates

Source templates define the locations of the source materials that are managed by project templates.

Before you create a source templates, create the project template to which you want to attach the source template. Additionally, install the source plug-in that you require if it is not already installed. For information about installing plug-ins, see Installing plug-ins.
Source templates define the location of the source material for project templates.
  1. From the IBM UrbanCode Build dashboard, click Templates, then select the project template to which you want to attach the template.
  2. In the Source area, click Create.
  3. Using the New Source Template page, select the source plug-in from the Source Type list, then click Select.
    Initially, the File System source plug-in is available.
    Note: The fields that are used to configure a source template can vary depending on the source type selected. The following steps describe configuring a source template with the File System source plug-in. See the documentation for your specific source plug-in.
  4. Type a name for the source template in the Name field.
  5. Select a script from the Working Directory Script list.

    The selected script defines the path to the working directory for the source template. Initially, there are two scripts available: Default Workflow Directory, and Unique Job Directory. The Default Workflow Directory script uses the default directory of the agent that does the work, which is{agent}/var/work/project/{project}/{workflow}. The Unique Job Directory script uses a separate directory for each job: {agent}/var/work/job/{job_id}.

  6. Optional. Create your own working directory script:
    1. Click New Script, then select the pool from the list.
      The job runs on the first available agent in the selected pool.
    2. Type a name for the script in the Name, then type the property, such as ${variable}.
    3. Enter the script in the Script area.
      The script can include variables that use the property syntax: ${variable}, and BeanShell scriptlets ${bsh:...}.
    4. Click Save.
      User-created scripts become available the next time the list is accessed.
  7. To use an offset from the directory that is specified by the working directory script, enter it in the Directory Offset field.
    To specify the current working directory, use the period character '.'.
  8. Optional. Specify a filter to limit the source files that are used in the File Filters area. To use a precondition script for steps that use this template, select the script from the Step Pre-Condition Script list.
    Put each filter condition on a separate line. To include specific files, start the line with the plus character '+'. To exclude files, start the line with the minus character '-'. You can use the following wildcards in the files names: *, **, ?.
  9. Click Save.
To add properties to the template, see Creating project template properties.