Solution Template
Setting up a Solution Template
Setting up a solution template allows you to share a common application/connector configuration across different businesses or Connectivity platforms. A solution template can be either an application template or a connector template. All applications/connectors created from the same template share the same configurations.
A solution template can save your time by grouping your applications/connectors together for better management. You have the option to update the source template and synchronize updated configuration to all solutions created by your source template.
The template also allows you to add your own lua scripts to be executed before each template deployment. Lua script is used to configure the services in the deployed solution.
This page assumes you are familiar with the relationship between applications and connectors. And you intend to make a template to make sure your new application/connector contains the same configuration.
Note
You are required to provide an access token to your GitHub or Azure DevOps repository to the platform. For maintenability, please use a service-account to create a token to reduce the need to change the token after a member leaves the project. In addition, for security, please consider the least privilege approach and only provide a token with read-only access to your repository.
Steps to create personal token for Solution Template.
We recommend our users to use a service account to generate a personal token. For Azure DevOps repositories:
- Login to Azure DevOps.
- Select User-settings icon, then go to "Personal access tokens".
- From there, click "+ New Token" button to add a new token.
- For the expiration time, Azure DevOps can provide a year-long token.
- For least privilege policy, user can just check the "Read" box under Code.
General Solution Template structure
The solution template consists of solution.yaml, service yaml files, and lua scripts (.lua files):
- solution.yaml consists of a template's configurations (file and folder filter and so on).
- Service yaml files are placed inside services folder, you can have add more services to your template by adding and removing the yaml files.
- For available services, please check the list of services available in Service APIs.
- By adding a yaml file with service API name (e.g. timer.yaml). You are adding a service to the template.
- By removing a yaml file with service API name, You are removing the service from the template's future deployment.
- Lua scripts are placed inside modules folder, services folder, or init.lua:
- Within module folder, you can place lua scripts and re-use them in other parts of the template.
- Within service folder, you can create default service event scripts.
- Within init.lua, the script will be executed in every deployment.
Setting up an application template
We provide a zip file containing basic services required to create an application template. Extract the zip file and create a GitHub or Azure DevOps repository.
- The default services includes Webasset, Webservice, Websocket.
- The endpoint folder includes the endpoints you intend to include in the application.
Setting up a connector template
We provide a zip file containing basic services required to create a connector template. Extract the zip file and create a GitHub or Azure DevOps repository.
Note
For more configuration details, please check README.md in the zip file.
Solution Template Deployment
The platform enables you to publish a solution template onto the Platform Marketplace. Once published, this template can be utilized multiple times to create various solutions.
Deploying a Solution Template to the Marketplace via Git Repository
The platform enables you to publish a solution template onto the Platform Marketplace using a GitHub URL or Azure DevOps URL with an access token. Once published, this template can be utilized multiple times to create various solutions.
Platform expects the default repository branch to be "master". You have the option to choose other branches by including branch name in the url. Such as GitHub's /tree/{branch-name} or Azure DevOps's version=GB{Branch-name}.
- Azure DevOps repo Url example:
- Azure Devops repo Url with branch example:
Follow these steps to publish a solution template to Marketplace from the Connectivity Platform UI:
- In Connectivity Platform UI, navigate to the 'Marketplace' page of your Business.
- Access to the 'Manage' page.
- Find the 'PUBLISH NEW ELEMENT' button and click.
- Select 'Application Template' or 'Connector Template' from 'Type' drop-down list.
- Opt for 'Git Repository' in the section 'Source'.
- Input the git URL as well as your Token (i.e., your Git credential).
- Hit the 'FETCH REPO' button.
- Input the additional required information relating to your Connector or Application.
- To finalize your solution template publish, press the 'PUBLISH' button."
Deploying a Solution Template to the Marketplace through Zip File Import
The platform enables you to publish a solution template onto the Platform Marketplace using a Zip file. For guidance on preparing a proper Zip file, please refer to Template structure. If you already have a solution in use, you can directly export it as a Zip file. For more details, please refer to Exporting a solution template.
Follow these steps to publish a solution template to Marketplace from the Connectivity Platform UI:
- In Connectivity Platform UI, navigate to the 'Marketplace' page of your Business.
- Access to the 'Manage' page.
- Find the 'PUBLISH NEW ELEMENT' button and click.
- Select 'Application Template' or 'Connector Template' from 'Type' drop-down list.
- Opt for 'Zip file' in the section 'Source'.
- Click "SELECT ZIP FILE" to open the File Explorer window and choose the prepared zip file.
- Input the additional required information relating to your Connector or Application.
- To finalize your solution template publish, press the 'PUBLISH' button."
Exporting a Solution Template
The platform offers a capability that allows you to generate a static compressed (zip) file from your existing solution, serving as a reusable template for future applications.
Follow these steps to generate a solution template zip file from the Connectivity Platform UI:
- In Connectivity Platform UI, navigate to the 'Settings' page of your solution.
- Switch to the 'CONFIGURATION' tab.
- Find the 'Distribution' section and click on the 'EXPORT' button.
- A zip file corresponding to your solution will be automatically downloaded to your local drive.
Solution Creation
The platform provides flexibility in its features, allowing you to create a solution via a Git URL, import from a zip file, or utilize a solution template.
Creating a Solution without the Need for a Template
Before creating a solution, ensure to have either a Git repository adhering to the Solution template structure, or a prepared solution template in the form of a Zip file(refer to Exporting a solution template).
Follow these steps to create a solution directly from the Connectivity Platform UI:
- In the Connectivity Platform UI, click the 'New Connector' or 'New Application' button.
- Opt for 'Git Repository' or Zip file in the section 'Choose the starting point'.
- Input the git URL as well as your Token (i.e., your Git credential) or choose a prepared zip file from your local drive.
- Hit the 'FETCH REPO' button if you opt for 'Git Repository'.
- Input the additional required information relating to your Connector or Application.
- To finalize your solution creation, press the 'CREATE' button".
Creating a Solution from a Template
Before creating a solution, ensure to have deployed a solution template on Platform Marketplace(refer to Solution Template Deployment).
Follow these steps to create a solution from a solution template:
- In the Connectivity Platform UI, click the 'New Connector' or 'New Application' button.
- Opt for 'Template' in the section 'Choose the starting point'.
- Choose a created template.
- Input the additional required information relating to your Connector or Application.
- To finalize your solution creation, press the 'CREATE' button".