Component templates enable you to save and reuse component processes and properties and create new components from them. Template-based components inherit the template properties and processes.
Create component templates
When you have multiple Deployment Automation servers, such as test and production servers, you can create and validate component templates on the test server, then export these templates, and later import them into the production server.
To create a template:
Navigate to Management > Components.
Select the Component Template tab and click Create.
In the Name field, enter the template's name.
(Optional) in the Description field, enter a description to convey additional information about the template.
From the Source Config Type list, select the source location of your artifacts, and then specify the additional properties specific to that source configuration type. For details, see Source configuration types.
To start configuring the component template you just created, click Build Out.
You create processes for templates in the same way you do for components. For details, see Create and design component processes.
Add component template properties
Component template properties ensure that every component created from a template has the same properties. You can add properties one at a time or in a batch.
To add component template properties:
- Navigate to Management > Components > Component Templates.
- Select a template and click the Properties tab.
Select the tab for the type of component template properties you want to add:
Type Description Properties These general user-defined properties can be applied in scripts and plugins. Properties inherited from templates cannot be modified on the component level. If you change the value, it will be reflected in all components created from the template. Component Property Definitions These properties are set for every component. When you create a component using this template, the property is displayed in the Create Component dialog box. A value defined here can be changed by created components. Environment Property Definitions These properties are set for every environment that uses a component created by this template. The properties are listed on the environment's Component Mapping page:
Applications > [select application] > Environments > [select environment] > View Details > Component Mapping > Properties.
A value defined here can be changed by environment.
Version Property Definitions These properties are set for every version of the component.
Add one or several properties:
Note: For component, environment, and version property definitions, you must add properties one by one. For general properties, you can also use the Batch Edit option to add multiple properties at once.
To add a single property, click Add Property. In the Add Property dialog box, specify the following details:
Field Description Name Enter a name for the property. Description (Optional) Enter additional information about the property. Label (Optional) For component, environment, and version property definitions, enter a label to be associated with the property in the user interface. Required (Optional) For component, environment, ans version property definitions, select this option if you want the property to be required. Secure (Optional) For general properties, select this option if you want the property to be secure.
Secure properties are stored encrypted, and their values are displayed obscured in the Deployment Automation user interface.
For component, environment, ans version property definitions, select the type of expected value:
- Text. Enables you to enter text characters. This is the default type.
- Text area. Enables you to enter an amount of text.
- Check box. Displays the check box. If selected, a value of true is used. Otherwise, the property is not set.
- Select. Requires one or more values to be selected from the list. Enables a single selection.
- Multi select. Requires one or more values to be selected from the list. Enables multiple selections.
- Secure. Used for passwords. It is similar to Text, except the values are displayed obscured.
Value/Default Value (Optional) Enter the value of the property (if any).
To add multiple general properties, click Batch Edit. In the Edit Entry dialog box, specify each property on a new line in the following format:
Use this format to specify properties without values. For example, for the
Note: When you save properties without values, the system automatically changes the
Use this format for properties with values, for example:
Note: Take into account the following restrictions for batch editing:
- You cannot set the Secure option. If you want the properties to be secure, edit them individually.
- The value cannot contain the equals sign (=).
To edit a property, click the Edit icon next to the property.
When you export a component template, the system creates a JSON file that contains the template's configuration information, properties, and processes.
To export a component template:
Navigate to Management > Components.
Select the Component Templates tab.
In the list of component templates, click the Export icon next to the template.
You can load the file into a text editor or save it. If you save it, a file is created with the same name as the selected component template, for example, helloWorldTemplate.json.
Import component templates
When importing a component template, you can create an new template or upgrade an existing one.
To import a component template:
Navigate to Management > Components.
- Select the Component Templates tab and click Import.
If you want to upgrade an existing template, select Upgrade Template.
If the template's name in the JSON file (not the name of the file itself) matches an existing template, the template is upgraded. If the name is not found, the command has no effect.
Note: The template's name is the first parameter in the JSON file, for example:
From the Process Plugins Import Type list, select how you want to import plugin steps in processes.
The following table describes available options.
Option Description Import processes as is Select this option to import processes without changes.
If a process uses a plugin that is not available on the target sever, the import fails.
Upgrade processes to latest plugins
Leave this option selected to upgrade all imported plugin steps to a later plugin version available on the target server.
You don't need to have current plugin versions if more recent versions are available on the target server.
This is the default option.
Ignore missing plugins Select this option to import processes even if they use plugins that are missing from the target server.
- In the Choose File field, navigate to the JSON file containing the template.
Create a component from a template
When you create a component based on a template, the component inherits any processes and properties from the template.
To create a template-based component:
Navigate to Management > Components > Create. The Create Component dialog box opens.
Enter a name and an optional description for the component.
From the Template list, select a component template.
If a template has a defined source config type, the dialog box will automatically display values defined for the template. For details, see Create components.
Specify the remaining properties and click Save.
The name of the template is displayed next to the component in the Uses Template column on the Components page.