You might want to modify existing project templates or even create a complete new one, to instantiate new projects based on your own templates – adapted to your specific processes.
Here I will explain the absolute basics about the structure of project templates.
To understand project templates, lets take a look at the project structure in the repository.
Projects have a structure like this in the repository:
- .polarion – Contains most: configurations, test runs, free work items etc.
- wiki – Is for old wiki pages (Rarely used nowadays)
- modules – Documents and the work items they contain
These folders contain everything project related. Configurations, work items, documents etc.
If you want to have a project template based on an existing project, you have to do at least four things:
- Copy the project out of the repository
- Add a text file called template.properties to the project folder
- Replace the project id in .polarion/polarion-project.xml through %project-id%
- Zip the folder and upload it in the global administration under “Project Templates”
The template.properties needs to contain at least the following content:
name=Template_Name description=Description of the Template process=.polarion/polarion-project.xml; trackerPrefixToReplace=ABC
Quick explanation of the content:
- name – is the name of the template
- description – the description shown, when you select the template during creation
- process – these are the files, which Polarion will go trough during the creation process and will replace the variables %project-id% trough the entered project id during creation.
- trackerPrefixToReplace – the prefix of work items in the project to replace it be the new tracker prefix.
After adding the template.properties file you have to Zip the whole folder. (The zip file will contain the project template folder)
After uploading the project template to Polarion in the global administration, you can select the template during project creation.
In upcoming posts I will show an example, how you can create an automatic build management for template creation with Jenkins. If you want to go for it via Polarion Build Management only, check this out: https://extensions.polarion.com/extensions/234-template-factory
This is a project, where a build management is configured, so that a template will be created out of the current project. Including changing author names to system administrator.